Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 190dedc

Browse files
Add fast scroll bar
1 parent abfc0fc commit 190dedc

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ I need feedback to see if these are only happening to some people or if they're
2323
## Third-party libraries/code
2424
- [Parsing](https://github.com/David-Mawer/OreoWifiPasswords/blob/0d146fd34ce424b8a500a441ff2a1293c3355a33/app/src/main/java/com/pithsoftware/wifipasswords/task/TaskLoadWifiEntries.java) and [data management code](https://github.com/David-Mawer/OreoWifiPasswords/blob/ae0d7e7f290345bdf1a2d0742b8da5d25a76807b/app/src/main/java/com/pithsoftware/wifipasswords/pojo/WifiEntry.java) by [David-Mawer](https://github.com/David-Mawer/) has been used, adapted, and converted to Kotlin.
2525
- [QRGen: a simple QRCode generation api for java built on top ZXING](https://github.com/kenglxn/QRGen)
26-
26+
-[RecyclerView-FastScroll: A simple `FastScroller` for Android's `RecyclerView`](https://github.com/timusus/RecyclerView-FastScroll)
2727
## License
2828
Copyright (C) 2018 hacker1024 (on github.com)
2929

‎app/build.gradle‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dependencies {
4141
compileOnly 'de.robv.android.xposed:api:53:sources'
4242
implementation 'com.github.kenglxn.QRGen:android:2.4.0'
4343
implementation 'com.crossbowffs.remotepreferences:remotepreferences:0.5'
44+
implementation 'com.simplecityapps:recyclerview-fastscroll:1.0.17'
4445

4546
// Ads are disables while my account's under review.
4647
// START AD SERVICES

‎app/src/main/java/tk/superl2/xwifi/MainActivity.kt‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import android.view.Menu
2222
import android.view.MenuItem
2323
import android.view.ViewGroup
2424
import android.widget.*
25+
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
2526
import kotlinx.android.synthetic.main.activity_main.*
2627
import kotlinx.android.synthetic.main.wifi_list_item.view.*
2728
import net.glxn.qrgen.android.QRCode
@@ -60,7 +61,7 @@ class MainActivity: AppCompatActivity() {
6061
}
6162

6263
// The adapter class for the RecyclerView
63-
inner class WifiListAdapter: RecyclerView.Adapter<WifiListAdapter.ViewHolder>(), Filterable {
64+
inner class WifiListAdapter: RecyclerView.Adapter<WifiListAdapter.ViewHolder>(), Filterable, FastScrollRecyclerView.SectionedAdapter {
6465
// The ViewHolder class for the adapter
6566
inner class ViewHolder(val item: LinearLayout) : RecyclerView.ViewHolder(item) {
6667
// The WifiEntry object associated with the list item
@@ -153,8 +154,10 @@ class MainActivity: AppCompatActivity() {
153154
wifiList = if (constraint == "") wifiEntries else results.values as ArrayList<WifiEntry>
154155
notifyDataSetChanged()
155156
}
156-
157157
}
158+
159+
override fun getSectionName(position: Int) =
160+
(wifi_RecyclerView.layoutManager.findViewByPosition(position)?.label?.text ?: " ")[0].toUpperCase().toString()
158161
}
159162

160163
override fun onBackPressed() {

‎app/src/main/res/layout/activity_main.xml‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@
77
android:orientation="vertical"
88
tools:context=".MainActivity">
99

10-
<android.support.v7.widget.RecyclerView
10+
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
1111
android:id="@+id/wifi_RecyclerView"
1212
android:layout_width="match_parent"
1313
android:layout_height="0dp"
1414
android:layout_weight="1"
15-
android:scrollbars="vertical" />
15+
app:fastScrollPopupBgColor="?android:attr/textColorAlertDialogListItem"
16+
app:fastScrollPopupTextColor="?android:attr/colorBackground"
17+
app:fastScrollThumbColor="?android:attr/textColorAlertDialogListItem"
18+
app:fastScrollPopupPosition="adjacent"/>
1619

1720
<!-- Ads are disabled while my account's getting reviewed. -->
1821
<!--<com.mopub.mobileads.MoPubView-->
19-
<!--android:id="@+id/adview"-->
20-
<!--android:layout_width="fill_parent"-->
21-
<!--android:layout_height="50dp"-->
22-
<!--android:layout_weight="0" />-->
22+
<!--android:id="@+id/adview"-->
23+
<!--android:layout_width="fill_parent"-->
24+
<!--android:layout_height="50dp"-->
25+
<!--android:layout_weight="0" />-->
2326
</LinearLayout>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /