-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
# Conflicts: # .idea/codeStyles/Project.xml # .idea/misc.xml # build.gradle
- Loading branch information
Showing
12 changed files
with
596 additions
and
16 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/src/main/java/com/arabiait/myapplication/application/MyApp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.arabiait.myapplication.application | ||
|
||
import android.app.Application | ||
import com.facebook.stetho.Stetho | ||
import io.realm.Realm | ||
|
||
class MyApp : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
Realm.init(this) | ||
Stetho.initializeWithDefaults(this) | ||
|
||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/arabiait/myapplication/pojo/PojoTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.arabiait.myapplication.pojo | ||
|
||
import io.realm.RealmObject | ||
import io.realm.annotations.PrimaryKey | ||
|
||
open class PojoTest( | ||
var name: String = "", | ||
var age: Int = 0 | ||
//@PrimaryKey var id: Long = 0 | ||
): RealmObject(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/src/main/java/com/arabiait/myapplication/util/EndlessScrollListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.arabia_it.baserapp.util | ||
|
||
/** | ||
* Created by Net6 on 11/12/2017. | ||
*/ | ||
|
||
import android.widget.AbsListView | ||
import androidx.recyclerview.widget.GridLayoutManager | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
|
||
abstract class EndlessScrollListener : RecyclerView.OnScrollListener { | ||
// The minimum number of items to have below your current scroll position | ||
// before loading more. | ||
private var visibleThreshold = 5 | ||
|
||
constructor(visibleThreshold: Int) { | ||
this.visibleThreshold = visibleThreshold | ||
} | ||
|
||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { | ||
super.onScrolled(recyclerView, dx, dy) | ||
|
||
recyclerView.layoutManager?.let { layoutManager -> | ||
|
||
val totalItemCount = layoutManager.itemCount | ||
val visibleItemCount = layoutManager.childCount | ||
var firstVisibleItem = 0 | ||
when (layoutManager) { | ||
is LinearLayoutManager -> firstVisibleItem = layoutManager.findFirstVisibleItemPosition() | ||
is GridLayoutManager -> firstVisibleItem = layoutManager.findFirstVisibleItemPosition() | ||
else -> return | ||
} | ||
if (firstVisibleItem + visibleItemCount + visibleThreshold >= totalItemCount) { | ||
onLoadMore() | ||
} | ||
} | ||
|
||
} | ||
|
||
abstract fun onLoadMore() | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Wed Apr 03 09:36:52 EET 2019 | ||
#Tue Jun 11 09:44:50 EET 2019 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip |