-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add setup for optional permissions
- Loading branch information
1 parent
0d08023
commit 25b8db9
Showing
18 changed files
with
232 additions
and
32 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
app/src/main/java/me/timschneeberger/rootlessjamesdsp/preference/IconPreference.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,21 @@ | ||
package me.timschneeberger.rootlessjamesdsp.preference | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import androidx.preference.Preference | ||
import me.timschneeberger.rootlessjamesdsp.R | ||
|
||
|
||
open class IconPreference( | ||
mContext: Context, val attrs: AttributeSet?, | ||
defStyleAttr: Int, defStyleRes: Int, | ||
) : Preference(mContext, attrs, defStyleAttr, defStyleRes) { | ||
|
||
@JvmOverloads | ||
constructor( | ||
context: Context, attrs: AttributeSet? = null, | ||
defStyle: Int = androidx.preference.R.attr.preferenceStyle, | ||
) : this(context, attrs, defStyle, 0) { | ||
layoutResource = R.layout.preference_icon | ||
} | ||
} |
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
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
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,52 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:gravity="start" | ||
android:orientation="horizontal" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingTop="12dp" | ||
android:paddingBottom="8dp" | ||
android:baselineAligned="false" | ||
android:minHeight="?android:attr/listPreferredItemHeightSmall" | ||
android:paddingStart="?android:attr/listPreferredItemPaddingStart" | ||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> | ||
|
||
<LinearLayout | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:orientation="vertical"> | ||
|
||
<TextView android:textAppearance="?android:attr/textAppearanceListItem" | ||
android:ellipsize="marquee" | ||
android:id="@android:id/title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:singleLine="true" | ||
tools:text="Title" /> | ||
|
||
<TextView android:textAppearance="?android:attr/textAppearanceListItemSecondary" | ||
android:ellipsize="marquee" | ||
android:gravity="start" | ||
android:id="@android:id/summary" | ||
android:scrollbars="none" | ||
android:fadingEdge="horizontal" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="8dp" | ||
android:layout_marginBottom="8dp" | ||
android:singleLine="true" | ||
tools:text="Value" /> | ||
|
||
</LinearLayout> | ||
|
||
<androidx.appcompat.widget.AppCompatImageView | ||
android:id="@android:id/icon" | ||
android:layout_width="24dp" | ||
android:layout_height="24dp" | ||
android:layout_gravity="center" | ||
tools:srcCompat="@drawable/ic_twotone_edit_24dp" /> | ||
|
||
</LinearLayout> |
Oops, something went wrong.