Skip to content

Commit

Permalink
Fix/small issues (#364)
Browse files Browse the repository at this point in the history
* fixed small text

close #363

* moved logout to bottom

* avoid restarting app when logging out if no credentials are found

close #360

* updated libraries

* bumped version for release

* updated workflow
  • Loading branch information
LivingWithHippos authored Feb 20, 2024
1 parent ec60e35 commit 7bddde0
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 35 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -28,9 +28,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -46,17 +46,17 @@ jobs:
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: ./gradlew clean assembleRelease --stacktrace
- name: Save apk
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: apk
path: /home/runner/work/unchained-android/unchained-android/app/app/build/outputs/apk/release/*.apk
build-debug:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand All @@ -72,7 +72,7 @@ jobs:
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: ./gradlew clean assembleDebug --stacktrace
- name: Save apk
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: apk-debug
path: /home/runner/work/unchained-android/unchained-android/app/app/build/outputs/apk/debug/*.apk
4 changes: 2 additions & 2 deletions app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ android {
applicationId "com.github.livingwithhippos.unchained"
minSdk 22
targetSdk 34
versionCode 42
versionName "1.2.0"
versionCode 43
versionName "1.2.1"
// limit resources for a list of locales
// resConfigs "en", "it"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ class SettingsFragment : PreferenceFragmentCompat() {
context?.showToast(R.string.user_logged_out)
activity?.finishAffinity()
}
SettingEvent.LogoutNoCredentials -> {
context?.showToast(R.string.no_credentials_found)
}
null -> {
// do nothing
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,19 @@ constructor(

fun userLogout() {
viewModelScope.launch {
protoStore.deleteCredentials()
eventLiveData.postEvent(SettingEvent.Logout)
val credentials = protoStore.getCredentials()
if (credentials.accessToken.isBlank() && credentials.clientId.isBlank()) {
eventLiveData.postEvent(SettingEvent.LogoutNoCredentials)
} else {
protoStore.deleteCredentials()
eventLiveData.postEvent(SettingEvent.Logout)
}
}
}
}

sealed class SettingEvent {
object Logout : SettingEvent()
data object Logout : SettingEvent()

data object LogoutNoCredentials : SettingEvent()
}
4 changes: 2 additions & 2 deletions app/app/src/main/res/layout/fragment_torrent_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
app:srcCompat="@drawable/icon_share" />

<TextView
android:textAppearance="?attr/textAppearanceLabelSmall"
style="@style/TextAppearance.UnchainedTheme.Body2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
Expand All @@ -104,7 +104,7 @@
app:srcCompat="@drawable/icon_open_external" />

<TextView
android:textAppearance="?attr/textAppearanceLabelSmall"
style="@style/TextAppearance.UnchainedTheme.Body2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
Expand Down
1 change: 1 addition & 0 deletions app/app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -524,4 +524,5 @@
<string name="services_search_description">Utiliza servicios como Jackett, Prowlarr o cualquier app de Torznab.</string>
<string name="all">todos</string>
<string name="search_options">Opciones de búsqueda</string>
<string name="no_credentials_found">No se han encontrado credenciales</string>
</resources>
1 change: 1 addition & 0 deletions app/app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -524,4 +524,5 @@
<string name="services_search_description">Utilisez des services tels que Jackett, Prowlarr ou toute autre application Torznab.</string>
<string name="all">tous</string>
<string name="search_options">Options de recherche</string>
<string name="no_credentials_found">Aucun justificatif n\'a été trouvé</string>
</resources>
1 change: 1 addition & 0 deletions app/app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -527,4 +527,5 @@
<string name="services_search_description">Utilizza servizi come Jackett, Prowlarr o qualunque server Torznab.</string>
<string name="all">tutti</string>
<string name="search_options">Opzioni ricerca</string>
<string name="no_credentials_found">Nessuna credenziale trovata</string>
</resources>
1 change: 1 addition & 0 deletions app/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -740,4 +740,5 @@
<string name="services_search_description">Use services such as Jackett, Prowlarr or any Torznab app.</string>
<string name="all">all</string>
<string name="search_options">Search Options</string>
<string name="no_credentials_found">No credentials found</string>
</resources>
31 changes: 12 additions & 19 deletions app/app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">


<Preference
android:key="user_logout"
app:title="@string/logout"
/>

<PreferenceCategory
android:summary="@string/restart_to_apply"
android:title="@string/title_aspect">
Expand All @@ -33,14 +27,13 @@
<PreferenceCategory android:title="@string/download">

<SeekBarPreference
app:title="@string/loading_size"
app:key="paging_size"
app:summary="@string/summary_loading_size"
android:min="50"
android:max="2500"
android:defaultValue="50"
android:max="2500"
android:min="50"
app:key="paging_size"
app:showSeekBarValue="true"
/>
app:summary="@string/summary_loading_size"
app:title="@string/loading_size" />

<DropDownPreference
android:defaultValue="download_manager_system"
Expand Down Expand Up @@ -88,8 +81,7 @@
<Preference
app:key="install_plugins_instructions"
app:summary="@string/install_plugins_summary"
app:title="@string/install_plugins"
/>
app:title="@string/install_plugins" />

<Preference
app:key="delete_external_plugins"
Expand Down Expand Up @@ -140,18 +132,15 @@
android:title="@string/default_media_player"
app:useSimpleSummaryProvider="true" />

<Preference
android:summary="@string/custom_media_player_summary"
/>
<Preference android:summary="@string/custom_media_player_summary" />

<EditTextPreference
android:defaultValue=""
android:key="custom_media_player"
android:selectAllOnFocus="true"
android:singleLine="true"
android:title="@string/custom_media_player"
app:useSimpleSummaryProvider="true"
/>
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
</PreferenceCategory>

Expand Down Expand Up @@ -227,6 +216,10 @@

<PreferenceCategory android:title="@string/title_various">

<Preference
android:key="user_logout"
app:title="@string/logout" />

<EditTextPreference
android:defaultValue="10"
android:inputType="number"
Expand Down
2 changes: 1 addition & 1 deletion app/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ versions.constraint_layout = "2.1.4"
versions.coil = "2.5.0"
versions.core_ktx = "1.12.0"
versions.coroutines = "1.8.0"
versions.countly = "24.1.0"
versions.countly = "24.1.1"
versions.dagger = "2.50"
versions.espresso = "3.5.1"
versions.datastore = "1.0.0"
Expand Down

0 comments on commit 7bddde0

Please sign in to comment.