Skip to content

Commit

Permalink
Minor fixes + version number in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabwhy committed May 8, 2023
1 parent 623c8c8 commit eb01a6a
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 40 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
applicationId "com.barnabwhy.picozen"
minSdk 29
targetSdk 33
versionCode 1
versionName "0.0.4"
versionCode 5
versionName "0.0.5"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/barnabwhy/picozen/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import android.widget.TextView;

import org.json.JSONObject;
import org.w3c.dom.Text;

import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -299,6 +300,9 @@ private void openSettings() {
ButtonManager.requestAccessibility(this);
});

TextView versionText = dialog.findViewById(R.id.version_number);
versionText.setText(String.format(getResources().getString(R.string.version_text), BuildConfig.VERSION_NAME));

View iconRefresh = dialog.findViewById(R.id.refresh_icon_cache);
iconRefresh.setOnClickListener(view -> {
AppsAdapter.clearAllIcons(this);
Expand Down
99 changes: 61 additions & 38 deletions app/src/main/res/layout/dialog_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,71 @@
android:layout_marginTop="30dp"
android:layout_marginBottom="15dp" />

<LinearLayout
android:id="@+id/configure_accessibility"
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/bg_list_item_s"
android:padding="15dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:text="@string/shortcut_prompt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textStyle="bold"
android:gravity="center_vertical"
android:textColor="@color/link"
android:text="@string/configure" />
</LinearLayout>
android:layout_height="0dp"
android:layout_weight="1"
android:scrollbars="none"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:showDividers="middle"
android:divider="@drawable/divider">
<LinearLayout
android:id="@+id/configure_accessibility"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/bg_list_item_s"
android:padding="15dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:text="@string/shortcut_prompt" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textStyle="bold"
android:gravity="center_vertical"
android:textColor="@color/link"
android:text="@string/configure" />
</LinearLayout>

<LinearLayout
android:id="@+id/refresh_icon_cache"
<LinearLayout
android:id="@+id/refresh_icon_cache"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/bg_list_item_s"
android:padding="15dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:text="@string/refresh_icon_cache" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textStyle="bold"
android:gravity="center_vertical"
android:textColor="@color/link"
android:text="@string/refresh" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<TextView
android:id="@+id/version_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/bg_list_item_s"
android:padding="15dp">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:text="@string/refresh_icon_cache" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textStyle="bold"
android:gravity="center_vertical"
android:textColor="@color/link"
android:text="@string/refresh" />
</LinearLayout>

android:text="@string/version_text"
android:textSize="11sp"
android:textStyle="bold"
android:layout_marginVertical="25dp"
android:layout_marginHorizontal="10dp"
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<string name="changelog_header">What\'s new:</string>
<string name="made_with_love">Made by Barnaby</string>
<string name="gh_repo">barnabwhy/PicoZen</string>
<string name="version_text">v%1$s</string>

<string-array name="sort_options">
<item>↓ Name</item>
Expand Down

0 comments on commit eb01a6a

Please sign in to comment.