Browse Source

clean up build-gradle

* remove unused dependencies
pull/18/head
Jannik 2 years ago
parent
commit
b72b316ce1
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
  1. 3
      .gitignore
  2. 13
      app/build.gradle
  3. 15
      app/src/main/java/org/mosad/teapod/ui/home/HomeFragment.kt
  4. 13
      app/src/main/java/org/mosad/teapod/ui/home/HomeViewModel.kt
  5. 24
      app/src/main/java/org/mosad/teapod/ui/search/SearchFragment.kt
  6. 13
      app/src/main/java/org/mosad/teapod/ui/search/SearchViewModel.kt
  7. 2
      app/src/main/res/layout/fragment_search.xml

3
.gitignore vendored

@ -15,8 +15,9 @@
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
release/
# Gradle files
.gradle/

13
app/build.gradle

@ -35,31 +35,26 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.navigation:navigation-fragment:2.3.0'
implementation 'androidx.navigation:navigation-ui:2.3.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
implementation 'androidx.security:security-crypto:1.1.0-alpha02'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'com.google.android.exoplayer:exoplayer-core:2.12.0'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.12.0'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.12.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.12.0'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

15
app/src/main/java/org/mosad/teapod/ui/home/HomeFragment.kt

@ -4,29 +4,22 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import kotlinx.android.synthetic.main.fragment_home.*
import org.mosad.teapod.R
class HomeFragment : Fragment() {
private lateinit var homeViewModel: HomeViewModel
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
homeViewModel = ViewModelProviders.of(this).get(HomeViewModel::class.java)
val root = inflater.inflate(R.layout.fragment_home, container, false)
val textView: TextView = root.findViewById(R.id.text_home)
homeViewModel.text.observe(viewLifecycleOwner, Observer {
textView.text = it
})
return root
return inflater.inflate(R.layout.fragment_home, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
text_home.text = "This is the home fragment"
println("HomeFragment created")
}
}

13
app/src/main/java/org/mosad/teapod/ui/home/HomeViewModel.kt

@ -1,13 +0,0 @@
package org.mosad.teapod.ui.home
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
class HomeViewModel : ViewModel() {
private val _text = MutableLiveData<String>().apply {
value = "This is the home Fragment"
}
val text: LiveData<String> = _text
}

24
app/src/main/java/org/mosad/teapod/ui/search/SearchFragment.kt

@ -4,28 +4,18 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import kotlinx.android.synthetic.main.fragment_search.*
import org.mosad.teapod.R
class SearchFragment : Fragment() {
private lateinit var notificationsViewModel: SearchViewModel
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_search, container, false)
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
notificationsViewModel =
ViewModelProviders.of(this).get(SearchViewModel::class.java)
val root = inflater.inflate(R.layout.fragment_search, container, false)
val textView: TextView = root.findViewById(R.id.text_notifications)
notificationsViewModel.text.observe(viewLifecycleOwner, Observer {
textView.text = it
})
return root
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
text_search.text = "This is the search Fragment"
}
}

13
app/src/main/java/org/mosad/teapod/ui/search/SearchViewModel.kt

@ -1,13 +0,0 @@
package org.mosad.teapod.ui.search
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
class SearchViewModel : ViewModel() {
private val _text = MutableLiveData<String>().apply {
value = "This is the search Fragment"
}
val text: LiveData<String> = _text
}

2
app/src/main/res/layout/fragment_search.xml

@ -8,7 +8,7 @@
tools:context=".ui.search.SearchFragment">
<TextView
android:id="@+id/text_notifications"
android:id="@+id/text_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close