Update libs, use M3 switch

This commit is contained in:
M M Arif
2022-10-02 11:25:37 +05:00
parent 01dec9a098
commit 737144f556
14 changed files with 73 additions and 79 deletions

View File

@@ -4,11 +4,11 @@ plugins {
apply plugin: 'com.android.application'
android {
compileSdkVersion 32
compileSdkVersion 33
defaultConfig {
applicationId "org.mian.gitnex"
minSdkVersion 23
targetSdkVersion 32
targetSdkVersion 33
versionCode 495
versionName "5.0.0-dev"
multiDexEnabled true
@@ -42,6 +42,7 @@ android {
lint {
abortOnError false
}
namespace 'org.mian.gitnex'
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
@@ -60,9 +61,9 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.compose.material3:material3:1.0.0-alpha15'
implementation 'androidx.compose.material3:material3-window-size-class:1.0.0-alpha15'
implementation 'com.google.android.material:material:1.8.0-alpha01'
implementation 'androidx.compose.material3:material3:1.0.0-beta03'
implementation 'androidx.compose.material3:material3-window-size-class:1.0.0-beta03'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.legacy:legacy-support-v4:1.0.0"
@@ -80,7 +81,7 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2'
implementation 'org.ocpsoft.prettytime:prettytime:5.0.2.Final'
implementation 'org.ocpsoft.prettytime:prettytime:5.0.4.Final'
implementation 'com.github.Pes8:android-material-color-picker-dialog:master'
implementation "io.noties.markwon:core:$markwon_version"
implementation "io.noties.markwon:ext-latex:$markwon_version"

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.mian.gitnex">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>

View File

@@ -10,7 +10,6 @@ import android.widget.TimePicker;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.switchmaterial.SwitchMaterial;
import org.mian.gitnex.R;
import org.mian.gitnex.databinding.ActivitySettingsAppearanceBinding;
import org.mian.gitnex.fragments.SettingsFragment;
@@ -47,8 +46,6 @@ public class SettingsAppearanceActivity extends BaseActivity {
activitySettingsAppearanceBinding.lightThemeTimeSelectionFrame;
LinearLayout darkTimeFrame = activitySettingsAppearanceBinding.darkThemeTimeSelectionFrame;
SwitchMaterial counterBadgesSwitch = activitySettingsAppearanceBinding.switchCounterBadge;
customFontList = getResources().getStringArray(R.array.fonts);
themeList = getResources().getStringArray(R.array.themes);
@@ -94,16 +91,19 @@ public class SettingsAppearanceActivity extends BaseActivity {
lightTimeFrame.setVisibility(View.GONE);
}
counterBadgesSwitch.setChecked(tinyDB.getBoolean("enableCounterBadges", true));
activitySettingsAppearanceBinding.switchCounterBadge.setChecked(
tinyDB.getBoolean("enableCounterBadges", true));
// counter badge switcher
counterBadgesSwitch.setOnCheckedChangeListener(
activitySettingsAppearanceBinding.switchCounterBadge.setOnCheckedChangeListener(
(buttonView, isChecked) -> {
tinyDB.putBoolean("enableCounterBadges", isChecked);
Toasty.success(appCtx, getResources().getString(R.string.settingsSave));
});
activitySettingsAppearanceBinding.counterBadgeFrame.setOnClickListener(
v -> counterBadgesSwitch.setChecked(!counterBadgesSwitch.isChecked()));
v ->
activitySettingsAppearanceBinding.switchCounterBadge.setChecked(
!activitySettingsAppearanceBinding.switchCounterBadge.isChecked()));
// show labels in lists(issues, pr) - default is color dots
activitySettingsAppearanceBinding.switchLabelsInListBadge.setChecked(

View File

@@ -13,7 +13,6 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.biometric.BiometricManager;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.switchmaterial.SwitchMaterial;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
@@ -63,8 +62,6 @@ public class SettingsSecurityActivity extends BaseActivity {
activitySettingsSecurityBinding.cacheSizeImagesSelectionFrame;
LinearLayout clearCacheFrame = activitySettingsSecurityBinding.clearCacheSelectionFrame;
SwitchMaterial switchBiometric = activitySettingsSecurityBinding.switchBiometric;
cacheSizeDataList = getResources().getStringArray(R.array.cacheSizeList);
cacheSizeImagesList = getResources().getStringArray(R.array.cacheSizeList);
@@ -86,10 +83,11 @@ public class SettingsSecurityActivity extends BaseActivity {
cacheSizeImagesSelectedChoice = tinyDB.getInt("cacheSizeImagesId");
}
switchBiometric.setChecked(tinyDB.getBoolean("biometricStatus", false));
activitySettingsSecurityBinding.switchBiometric.setChecked(
tinyDB.getBoolean("biometricStatus", false));
// biometric switcher
switchBiometric.setOnCheckedChangeListener(
activitySettingsSecurityBinding.switchBiometric.setOnCheckedChangeListener(
(buttonView, isChecked) -> {
if (isChecked) {
@@ -112,7 +110,8 @@ public class SettingsSecurityActivity extends BaseActivity {
case BiometricManager.BIOMETRIC_ERROR_UNSUPPORTED:
case BiometricManager.BIOMETRIC_STATUS_UNKNOWN:
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
activitySettingsSecurityBinding.switchBiometric.setChecked(
false);
Toasty.error(
appCtx,
getResources()
@@ -120,7 +119,8 @@ public class SettingsSecurityActivity extends BaseActivity {
break;
case BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE:
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
activitySettingsSecurityBinding.switchBiometric.setChecked(
false);
Toasty.error(
appCtx,
getResources()
@@ -128,7 +128,8 @@ public class SettingsSecurityActivity extends BaseActivity {
break;
case BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED:
tinyDB.putBoolean("biometricStatus", false);
switchBiometric.setChecked(false);
activitySettingsSecurityBinding.switchBiometric.setChecked(
false);
Toasty.info(
appCtx,
getResources().getString(R.string.enrollBiometric));
@@ -147,7 +148,9 @@ public class SettingsSecurityActivity extends BaseActivity {
});
activitySettingsSecurityBinding.biometricFrame.setOnClickListener(
v -> switchBiometric.setChecked(!switchBiometric.isChecked()));
v ->
activitySettingsSecurityBinding.switchBiometric.setChecked(
!activitySettingsSecurityBinding.switchBiometric.isChecked()));
// clear cache setter
File cacheDir = appCtx.getCacheDir();

View File

@@ -199,7 +199,7 @@
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchCounterBadge"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen24dp"
@@ -208,8 +208,7 @@
android:layout_toEndOf="@+id/tvCounterBadgeHeader"
android:gravity="end"
android:paddingStart="@dimen/dimen0dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp"/>
android:paddingEnd="@dimen/dimen24dp" />
</RelativeLayout>
@@ -246,13 +245,12 @@
android:gravity="center_vertical|end"
android:orientation="horizontal">
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchLabelsInListBadge"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen32dp"
android:paddingStart="@dimen/dimen24dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp" />
android:paddingEnd="@dimen/dimen24dp" />
</LinearLayout>

View File

@@ -32,7 +32,7 @@
android:contentDescription="@string/close"
android:focusable="true"
android:gravity="center_vertical"
android:src="@drawable/ic_close"/>
android:src="@drawable/ic_close" />
<TextView
android:id="@+id/toolbarTitle"
@@ -42,7 +42,7 @@
android:maxLines="1"
android:text="@string/draftsHeader"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen20sp"/>
android:textSize="@dimen/dimen20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@@ -71,7 +71,7 @@
android:layout_marginStart="@dimen/dimen24dp"
android:text="@string/settingsEnableCommentsDeletionText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
android:textSize="@dimen/dimen18sp" />
<LinearLayout
android:layout_width="wrap_content"
@@ -80,13 +80,12 @@
android:gravity="center_vertical|end"
android:orientation="horizontal">
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/commentsDeletionSwitch"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen32dp"
android:paddingStart="@dimen/dimen24dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp"/>
android:paddingEnd="@dimen/dimen24dp" />
</LinearLayout>
@@ -100,7 +99,7 @@
android:layout_marginEnd="@dimen/dimen72dp"
android:text="@string/settingsEnableCommentsDeletionHintText"
android:textColor="?attr/hintColor"
android:textSize="@dimen/dimen12sp"/>
android:textSize="@dimen/dimen12sp" />
</RelativeLayout>

View File

@@ -142,7 +142,7 @@
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchTabs"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen24dp"
@@ -151,8 +151,7 @@
android:layout_toEndOf="@+id/customTabsHeader"
android:gravity="end"
android:paddingStart="@dimen/dimen0dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp"/>
android:paddingEnd="@dimen/dimen24dp" />
</RelativeLayout>

View File

@@ -34,7 +34,7 @@
android:contentDescription="@string/close"
android:focusable="true"
android:gravity="center_vertical"
android:src="@drawable/ic_close"/>
android:src="@drawable/ic_close" />
<TextView
android:id="@+id/toolbar_title"
@@ -44,7 +44,7 @@
android:maxLines="1"
android:text="@string/pageTitleNotifications"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen20sp"/>
android:textSize="@dimen/dimen20sp" />
</androidx.appcompat.widget.Toolbar>
@@ -68,7 +68,7 @@
android:layout_marginStart="@dimen/dimen24dp"
android:text="@string/enableNotificationsHeaderText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
android:textSize="@dimen/dimen18sp" />
<LinearLayout
android:layout_width="wrap_content"
@@ -77,13 +77,12 @@
android:gravity="center_vertical|end"
android:orientation="horizontal">
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/enableNotificationsMode"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen32dp"
android:paddingStart="@dimen/dimen24dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp"/>
android:paddingEnd="@dimen/dimen24dp" />
</LinearLayout>
@@ -106,7 +105,7 @@
android:layout_marginEnd="@dimen/dimen24dp"
android:text="@string/notificationsPollingHeaderText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
android:textSize="@dimen/dimen18sp" />
<TextView
android:id="@+id/pollingDelaySelected"
@@ -116,7 +115,7 @@
android:layout_marginEnd="@dimen/dimen24dp"
android:text="@string/pollingDelaySelectedText"
android:textColor="?attr/selectedTextColor"
android:textSize="@dimen/dimen16sp"/>
android:textSize="@dimen/dimen16sp" />
</LinearLayout>
@@ -137,9 +136,9 @@
android:layout_marginEnd="@dimen/dimen24dp"
android:text="@string/enableLightsHeaderText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
android:textSize="@dimen/dimen18sp" />
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/enableLightsMode"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen24dp"
@@ -148,8 +147,7 @@
android:layout_toEndOf="@+id/enableLightsHeader"
android:gravity="end"
android:paddingStart="@dimen/dimen0dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp"/>
android:paddingEnd="@dimen/dimen24dp" />
</RelativeLayout>
@@ -170,7 +168,7 @@
android:layout_marginEnd="@dimen/dimen24dp"
android:text="@string/chooseColorSelectorHeader"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
android:textSize="@dimen/dimen18sp" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/chooseColorState"
@@ -182,7 +180,7 @@
android:layout_marginEnd="@dimen/dimen28dp"
android:gravity="end"
app:cardCornerRadius="@dimen/dimen16dp"
app:cardElevation="@dimen/dimen0dp"/>
app:cardElevation="@dimen/dimen0dp" />
</RelativeLayout>
@@ -203,9 +201,9 @@
android:layout_marginEnd="@dimen/dimen72dp"
android:text="@string/enableVibrationHeaderText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
android:textSize="@dimen/dimen18sp" />
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/enableVibrationMode"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen24dp"
@@ -214,8 +212,7 @@
android:layout_toEndOf="@+id/enableVibrationHeader"
android:gravity="end"
android:paddingStart="@dimen/dimen0dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp"/>
android:paddingEnd="@dimen/dimen24dp" />
</RelativeLayout>

View File

@@ -31,7 +31,7 @@
android:contentDescription="@string/close"
android:focusable="true"
android:gravity="center_vertical"
android:src="@drawable/ic_close"/>
android:src="@drawable/ic_close" />
<TextView
android:id="@+id/toolbar_title"
@@ -41,7 +41,7 @@
android:maxLines="1"
android:text="@string/reportViewerHeader"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen20sp"/>
android:textSize="@dimen/dimen20sp" />
</com.google.android.material.appbar.MaterialToolbar>
@@ -65,7 +65,7 @@
android:layout_marginStart="@dimen/dimen24dp"
android:text="@string/settingsEnableReportsText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
android:textSize="@dimen/dimen18sp" />
<LinearLayout
android:layout_width="wrap_content"
@@ -74,13 +74,12 @@
android:gravity="center_vertical|end"
android:orientation="horizontal">
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/crashReportsSwitch"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen32dp"
android:paddingStart="@dimen/dimen24dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp"/>
android:paddingEnd="@dimen/dimen24dp" />
</LinearLayout>

View File

@@ -66,7 +66,7 @@
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen18sp"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchBiometric"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen24dp"
@@ -75,8 +75,7 @@
android:layout_toEndOf="@+id/biometricHeader"
android:gravity="end"
android:paddingStart="@dimen/dimen0dp"
android:paddingEnd="@dimen/dimen24dp"
android:switchMinWidth="@dimen/dimen56dp"/>
android:paddingEnd="@dimen/dimen24dp" />
</RelativeLayout>

View File

@@ -79,7 +79,7 @@
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
android:padding="4dp"
android:text="@string/label"
android:text="@string/labelTxt"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableTopCompat="@drawable/ic_tag"

View File

@@ -79,7 +79,7 @@
android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center"
android:padding="4dp"
android:text="@string/label"
android:text="@string/labelTxt"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
app:drawableTopCompat="@drawable/ic_tag"

View File

@@ -99,7 +99,7 @@
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoPrivate"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -107,7 +107,7 @@
android:text="@string/newRepoPrivateCopy"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoAsTemplate"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -115,7 +115,7 @@
android:text="@string/repoPropertiesTemplate"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoEnableIssues"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -123,7 +123,7 @@
android:text="@string/repoPropertiesEnableIssues"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoEnableWiki"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -131,7 +131,7 @@
android:text="@string/repoPropertiesEnableWiki"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoEnablePr"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -139,7 +139,7 @@
android:text="@string/repoPropertiesEnablePr"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoEnableTimer"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -147,7 +147,7 @@
android:text="@string/repoPropertiesEnableTimeTracker"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoEnableMerge"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -155,7 +155,7 @@
android:text="@string/repoPropertiesEnableMergeCommits"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoEnableRebase"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -163,7 +163,7 @@
android:text="@string/repoPropertiesEnableRebase"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoEnableSquash"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -171,7 +171,7 @@
android:text="@string/repoPropertiesEnableSquash"
android:textColor="?attr/primaryTextColor"/>
<com.google.android.material.switchmaterial.SwitchMaterial
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/repoEnableForceMerge"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.android.tools.build:gradle:7.3.0'
}
}