Git Product home page Git Product logo

basic-android-kotlin-training-sports's Introduction

Sports - Solution Code

Solution code for Android Basics in Kotlin. Codelab: Adaptive Layouts.

Introduction

Sports app is a basic app to introduce beginner students to adaptive layouts. This app consists of two fragments: a sports topics list and a details screen. The details screen displays placeholder text for the sports news. This app demonstrated the use of SlidingPaneLayout.

Pre-requisites

You need to know:

  • How to download code into Android Studio and run it.
  • How to create and use fragments.
  • RecyclerView and adapters
  • Familiar with the Android architecture components ViewModel, and LiveData.
  • Basic knowledge of Navigation components.

Getting Started

  1. Download and run the app.

basic-android-kotlin-training-sports's People

Contributors

android-dev-lxl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

basic-android-kotlin-training-sports's Issues

Android Basics: Adaptive Layouts

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-adaptive-layouts?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-5%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-adaptive-layouts#10

In which task and step of the codelab can this issue be found?

Describe the problem
There is an SDK path in the local.properties files that cause me issues until I change it to my SDK path.
sdk.dir=/Users/jtavva/Library/Android/sdk

Steps to reproduce?
Clone the adaptive layout repository, switch to the starter branch, and rebuild the project.
You will see an error that the SDK path cannot be found

Versions
Android Studio version: 2021.2.1
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

Android Basics: Adaptive Layouts

"You will use SlidingPaneLayou t to"

The t in Layout is slightly out of the formatting. I'd do a PR but didn't see the codelab in the repo.

Android Basics: Adaptive Layouts

Sports news details are not displayed while using the app in landscape mode in phone devices. Only the title image view is displayed.

Android Basics: Adaptive Layouts-----------UNRESOLVED REFERENCE!!! URGENT!

This is the second started code with this error and I can't run it!! Why don't you put the rest of the import!?? This is is supposed to be a NEW project! Are they going to be doing this for projects Now?? I hope not!

Please tell me what it is so I can add it and move on!

See screenshot below!

Screen Shot 2022-05-19 at 6 28 41 PM

recreate fragment on button click

https://github.com/open-learning-exchange/myplanet/blob/eac970eb9a86eddb2c80a43aac660499bc04bdae/app/src/main/java/org/ole/planet/myplanet/ui/chat/ChatHistoryListFragment.kt

https://github.com/open-learning-exchange/myplanet/blob/chatHistory/app/src/main/java/org/ole/planet/myplanet/ui/chat/ChatDetailFragment.kt

I want to recreate these fragments ChatHistoryListFragment and ChatDetailFragment which are connected using the slidingPaneLayout on this button click newChat.

I have tried this methods but it does not seem to work. Is the slidingPaneLayout blocking them? Is there a function I can create for workaround for this?

//1
fragmentChatHistoryListBinding.newChat.setOnClickListener {
            val newFragment = ChatHistoryListFragment()
            requireActivity().supportFragmentManager.beginTransaction()
                .replace(R.id.fragment_container, newFragment)
                .addToBackStack(null)
                .commit()
}
//2
fragmentChatHistoryListBinding.newChat.setOnClickListener {
    val chatDetailFragment = requireActivity().supportFragmentManager.findFragmentById(R.id.details_container) as? ChatDetailFragment
    chatDetailFragment?.resetChatDetail()
}

//created function in ChatDetailFragment to clear my recyclerview
fun resetChatDetail() {
    mAdapter.clearData()
}

here is a screenshot of my layout
Screenshot 2023-11-13 17 09 16

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.