Material 3: Simplify cursor styling

Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
Stefan Niedermann 2022-11-04 12:46:52 +01:00
parent 946219e8d3
commit 9e8cf5df0a
6 changed files with 13 additions and 17 deletions

View file

@ -21,6 +21,8 @@ import androidx.lifecycle.ViewModelProvider;
import com.nextcloud.android.sso.AccountImporter;
import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.function.Function;
import it.niedermann.owncloud.notes.LockedActivity;
@ -42,6 +44,7 @@ public class ManageAccountsActivity extends LockedActivity implements IManageAcc
private ActivityManageAccountsBinding binding;
private ManageAccountsViewModel viewModel;
private ManageAccountAdapter adapter;
private final Executor executor = Executors.newSingleThreadExecutor();
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
@ -138,7 +141,7 @@ public class ManageAccountsActivity extends LockedActivity implements IManageAcc
.setNeutralButton(android.R.string.cancel, null)
.setPositiveButton(R.string.action_edit_save, (v, d) -> {
final var property = editText.getText().toString();
new Thread(() -> {
executor.execute(() -> {
try {
final var putSettingsCall = repository.putServerSettings(AccountImporter.getSingleSignOnAccount(this, localAccount.getAccountName()), settingsFactory.apply(property), getPreferredApiVersion(localAccount.getApiVersion()));
putSettingsCall.enqueue(new Callback<>() {
@ -160,7 +163,7 @@ public class ManageAccountsActivity extends LockedActivity implements IManageAcc
} catch (NextcloudFilesAppAccountNotFoundException e) {
ExceptionDialogFragment.newInstance(e).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName());
}
}).start();
});
})
.show();
try {

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
@ -27,7 +28,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
app:tabIndicatorColor="@color/defaultBrand" />
app:tabMode="fixed" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager2.widget.ViewPager2

View file

@ -46,7 +46,6 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/fg_default"
android:textIsSelectable="true"
android:theme="@style/textViewStyle"
tools:maxLength="200"
tools:text="@tools:sample/lorem/random" />
@ -66,7 +65,6 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/fg_default"
android:textIsSelectable="true"
android:theme="@style/textViewStyle"
tools:maxLength="300"
tools:text="@tools:sample/lorem/random" />

View file

@ -38,7 +38,6 @@
android:paddingStart="@dimen/spacer_2x"
android:paddingEnd="@dimen/spacer_2x"
android:textColor="@color/fg_default"
android:theme="@style/textViewStyle"
tools:text="@tools:sample/lorem/random" />
</ScrollView>

View file

@ -33,7 +33,6 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/fg_default"
android:textIsSelectable="true"
android:theme="@style/textViewStyle"
tools:text="@tools:sample/lorem/random" />
</ScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View file

@ -4,25 +4,21 @@
<style name="BaseTheme" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorAccent">@color/accent</item>
<item name="android:actionModeBackground">?attr/colorPrimary</item>
<item name="colorControlNormal">?attr/colorAccent</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:actionModeBackground">?attr/colorPrimary</item>
<item name="android:windowLightStatusBar">@bool/isDayMode</item>
<item name="android:statusBarColor">?attr/colorPrimary</item>
<item name="android:textColorLink">?android:colorAccent</item>
<item name="materialAlertDialogTheme">@style/MaterialAlertDialogTheme</item>
<item name="actionModeStyle">@style/actionModeStyle</item>
<item name="toolbarStyle">@style/toolbarStyle</item>
<item name="android:statusBarColor">?attr/colorPrimary</item>
<item name="android:windowLightStatusBar">@bool/isDayMode</item>
<item name="android:textColorLink">?android:colorAccent</item>
<item name="materialAlertDialogTheme">@style/MaterialAlertDialogTheme</item>
<item name="tabStyle">@style/tabStyle</item>
</style>
<style name="AppTheme" parent="BaseTheme" />
<style name="textViewStyle">
<item name="colorAccent">@color/cursorHandles</item>
<item name="android:textColorHighlight">@color/defaultTextHighlightBackground</item>
</style>
<style name="toolbarStyle" parent="@style/Widget.Material3.Toolbar">
<item name="android:background">?attr/colorPrimary</item>
</style>