mirror of
https://github.com/gitnex-org/gitnex.git
synced 2026-03-22 13:05:25 -05:00
Move code editor options to bottom sheet
This commit is contained in:
@@ -130,9 +130,6 @@
|
||||
<activity
|
||||
android:name=".activities.SettingsAppearanceActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
<activity
|
||||
android:name=".activities.SettingsCodeEditorActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
<activity
|
||||
android:name=".activities.ProfileActivity"
|
||||
android:configChanges="orientation|screenSize|smallestScreenSize|density|screenLayout|keyboard|keyboardHidden|navigation"/>
|
||||
|
||||
@@ -289,7 +289,7 @@ public class MainActivity extends BaseActivity
|
||||
UserInfoCallback callback) {
|
||||
Call<User> call = RetrofitClient.getApiInterface(this).userGetCurrent();
|
||||
call.enqueue(
|
||||
new Callback<User>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(
|
||||
@NonNull Call<User> call, @NonNull Response<User> response) {
|
||||
@@ -377,6 +377,12 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<User> call, @NonNull Throwable t) {
|
||||
if (fragment == null || !fragment.isAdded() || fragment.getView() == null) {
|
||||
if (callback != null) {
|
||||
callback.onUserAccountsLoaded();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (binding != null
|
||||
&& userAccountsList != null
|
||||
&& accountsAdapter != null) {
|
||||
@@ -394,6 +400,13 @@ public class MainActivity extends BaseActivity
|
||||
List<UserAccount> userAccountsList,
|
||||
UserAccountsNavAdapter accountsAdapter,
|
||||
UserInfoCallback callback) {
|
||||
if (!fragment.isAdded() || fragment.getView() == null) {
|
||||
if (callback != null) {
|
||||
callback.onUserAccountsLoaded();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
UserAccountsApi userAccountsApi = BaseApi.getInstance(this, UserAccountsApi.class);
|
||||
assert userAccountsApi != null;
|
||||
userAccountsApi
|
||||
@@ -401,7 +414,10 @@ public class MainActivity extends BaseActivity
|
||||
.observe(
|
||||
fragment.getViewLifecycleOwner(),
|
||||
userAccounts -> {
|
||||
if (!fragment.isAdded()) {
|
||||
if (!fragment.isAdded() || fragment.getView() == null) {
|
||||
if (callback != null) {
|
||||
callback.onUserAccountsLoaded();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (userAccounts != null && !userAccounts.isEmpty()) {
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
package org.mian.gitnex.activities;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.databinding.ActivitySettingsCodeEditorBinding;
|
||||
import org.mian.gitnex.fragments.SettingsFragment;
|
||||
import org.mian.gitnex.helpers.AppDatabaseSettings;
|
||||
import org.mian.gitnex.helpers.SnackBar;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
*/
|
||||
public class SettingsCodeEditorActivity extends BaseActivity {
|
||||
|
||||
private static String[] colorList;
|
||||
private static int colorSelectedChoice;
|
||||
private static String[] indentationList;
|
||||
private static int indentationSelectedChoice;
|
||||
private static String[] indentationTabsList;
|
||||
private static int indentationTabsSelectedChoice;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ActivitySettingsCodeEditorBinding activitySettingsCodeEditorBinding =
|
||||
ActivitySettingsCodeEditorBinding.inflate(getLayoutInflater());
|
||||
setContentView(activitySettingsCodeEditorBinding.getRoot());
|
||||
|
||||
activitySettingsCodeEditorBinding.topAppBar.setNavigationOnClickListener(v -> finish());
|
||||
|
||||
// color selector dialog
|
||||
colorList = getResources().getStringArray(R.array.ceColors);
|
||||
colorSelectedChoice =
|
||||
Integer.parseInt(
|
||||
AppDatabaseSettings.getSettingsValue(
|
||||
ctx, AppDatabaseSettings.APP_CE_SYNTAX_HIGHLIGHT_KEY));
|
||||
activitySettingsCodeEditorBinding.ceColorSelected.setText(colorList[colorSelectedChoice]);
|
||||
|
||||
activitySettingsCodeEditorBinding.ceColorSelectionFrame.setOnClickListener(
|
||||
view -> {
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder =
|
||||
new MaterialAlertDialogBuilder(ctx)
|
||||
.setTitle(R.string.ceSyntaxHighlightColor)
|
||||
.setSingleChoiceItems(
|
||||
colorList,
|
||||
colorSelectedChoice,
|
||||
(dialogInterfaceColor, i) -> {
|
||||
colorSelectedChoice = i;
|
||||
activitySettingsCodeEditorBinding.ceColorSelected
|
||||
.setText(colorList[i]);
|
||||
AppDatabaseSettings.updateSettingsValue(
|
||||
ctx,
|
||||
String.valueOf(i),
|
||||
AppDatabaseSettings
|
||||
.APP_CE_SYNTAX_HIGHLIGHT_KEY);
|
||||
|
||||
SettingsFragment.refreshParent = true;
|
||||
this.recreate();
|
||||
this.overridePendingTransition(0, 0);
|
||||
dialogInterfaceColor.dismiss();
|
||||
SnackBar.success(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.settingsSave));
|
||||
});
|
||||
|
||||
materialAlertDialogBuilder.create().show();
|
||||
});
|
||||
|
||||
// indentation selector dialog
|
||||
indentationList = getResources().getStringArray(R.array.ceIndentation);
|
||||
indentationSelectedChoice =
|
||||
Integer.parseInt(
|
||||
AppDatabaseSettings.getSettingsValue(
|
||||
ctx, AppDatabaseSettings.APP_CE_INDENTATION_KEY));
|
||||
activitySettingsCodeEditorBinding.indentationSelected.setText(
|
||||
indentationList[indentationSelectedChoice]);
|
||||
|
||||
activitySettingsCodeEditorBinding.indentationSelectionFrame.setOnClickListener(
|
||||
view -> {
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder =
|
||||
new MaterialAlertDialogBuilder(ctx)
|
||||
.setTitle(R.string.ceIndentation)
|
||||
.setSingleChoiceItems(
|
||||
indentationList,
|
||||
indentationSelectedChoice,
|
||||
(dialogInterfaceColor, i) -> {
|
||||
indentationSelectedChoice = i;
|
||||
activitySettingsCodeEditorBinding
|
||||
.indentationSelected.setText(
|
||||
indentationList[i]);
|
||||
AppDatabaseSettings.updateSettingsValue(
|
||||
ctx,
|
||||
String.valueOf(i),
|
||||
AppDatabaseSettings.APP_CE_INDENTATION_KEY);
|
||||
|
||||
SettingsFragment.refreshParent = true;
|
||||
this.recreate();
|
||||
this.overridePendingTransition(0, 0);
|
||||
dialogInterfaceColor.dismiss();
|
||||
SnackBar.success(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.settingsSave));
|
||||
});
|
||||
|
||||
materialAlertDialogBuilder.create().show();
|
||||
});
|
||||
|
||||
// indentation tabs selector dialog
|
||||
if (indentationList[indentationSelectedChoice].startsWith("Tabs")) {
|
||||
activitySettingsCodeEditorBinding.indentationTabsSelectionFrame.setVisibility(
|
||||
View.VISIBLE);
|
||||
} else {
|
||||
activitySettingsCodeEditorBinding.indentationTabsSelectionFrame.setVisibility(
|
||||
View.GONE);
|
||||
}
|
||||
|
||||
indentationTabsList = getResources().getStringArray(R.array.ceIndentationTabsWidth);
|
||||
indentationTabsSelectedChoice =
|
||||
Integer.parseInt(
|
||||
AppDatabaseSettings.getSettingsValue(
|
||||
ctx, AppDatabaseSettings.APP_CE_TABS_WIDTH_KEY));
|
||||
activitySettingsCodeEditorBinding.indentationTabsSelected.setText(
|
||||
indentationTabsList[indentationTabsSelectedChoice]);
|
||||
|
||||
activitySettingsCodeEditorBinding.indentationTabsSelectionFrame.setOnClickListener(
|
||||
view -> {
|
||||
MaterialAlertDialogBuilder materialAlertDialogBuilder =
|
||||
new MaterialAlertDialogBuilder(ctx)
|
||||
.setTitle(R.string.ceIndentationTabsWidth)
|
||||
.setSingleChoiceItems(
|
||||
indentationTabsList,
|
||||
indentationTabsSelectedChoice,
|
||||
(dialogInterfaceColor, i) -> {
|
||||
indentationTabsSelectedChoice = i;
|
||||
activitySettingsCodeEditorBinding
|
||||
.indentationTabsSelected.setText(
|
||||
indentationTabsList[i]);
|
||||
AppDatabaseSettings.updateSettingsValue(
|
||||
ctx,
|
||||
String.valueOf(i),
|
||||
AppDatabaseSettings.APP_CE_TABS_WIDTH_KEY);
|
||||
|
||||
SettingsFragment.refreshParent = true;
|
||||
this.recreate();
|
||||
this.overridePendingTransition(0, 0);
|
||||
dialogInterfaceColor.dismiss();
|
||||
SnackBar.success(
|
||||
ctx,
|
||||
findViewById(android.R.id.content),
|
||||
getString(R.string.settingsSave));
|
||||
});
|
||||
|
||||
materialAlertDialogBuilder.create().show();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package org.mian.gitnex.fragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.databinding.BottomSheetSettingsCodeEditorBinding;
|
||||
import org.mian.gitnex.helpers.AppDatabaseSettings;
|
||||
import org.mian.gitnex.helpers.SnackBar;
|
||||
|
||||
/**
|
||||
* @author mmarif
|
||||
*/
|
||||
public class BottomSheetSettingsCodeEditorFragment extends BottomSheetDialogFragment {
|
||||
|
||||
private BottomSheetSettingsCodeEditorBinding binding;
|
||||
private static int colorSelectedChoice;
|
||||
private static int indentationSelectedChoice;
|
||||
private static int indentationTabsSelectedChoice;
|
||||
private static String[] indentationList;
|
||||
|
||||
@Nullable @Override
|
||||
public View onCreateView(
|
||||
@NonNull LayoutInflater inflater,
|
||||
@Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
binding = BottomSheetSettingsCodeEditorBinding.inflate(inflater, container, false);
|
||||
|
||||
indentationList = getResources().getStringArray(R.array.ceIndentation);
|
||||
colorSelectedChoice =
|
||||
Integer.parseInt(
|
||||
AppDatabaseSettings.getSettingsValue(
|
||||
requireContext(), AppDatabaseSettings.APP_CE_SYNTAX_HIGHLIGHT_KEY));
|
||||
indentationSelectedChoice =
|
||||
Integer.parseInt(
|
||||
AppDatabaseSettings.getSettingsValue(
|
||||
requireContext(), AppDatabaseSettings.APP_CE_INDENTATION_KEY));
|
||||
indentationTabsSelectedChoice =
|
||||
Integer.parseInt(
|
||||
AppDatabaseSettings.getSettingsValue(
|
||||
requireContext(), AppDatabaseSettings.APP_CE_TABS_WIDTH_KEY));
|
||||
|
||||
setColorChipSelection(colorSelectedChoice);
|
||||
setIndentationChipSelection(indentationSelectedChoice);
|
||||
setIndentationTabsChipSelection(indentationTabsSelectedChoice);
|
||||
|
||||
updateTabsWidthVisibility();
|
||||
|
||||
binding.ceColorChipGroup.setOnCheckedStateChangeListener(
|
||||
(group, checkedIds) -> {
|
||||
if (checkedIds.size() == 1) {
|
||||
int newSelection = getColorChipPosition(checkedIds.get(0));
|
||||
if (newSelection != colorSelectedChoice) {
|
||||
colorSelectedChoice = newSelection;
|
||||
AppDatabaseSettings.updateSettingsValue(
|
||||
requireContext(),
|
||||
String.valueOf(newSelection),
|
||||
AppDatabaseSettings.APP_CE_SYNTAX_HIGHLIGHT_KEY);
|
||||
SettingsFragment.refreshParent = true;
|
||||
SnackBar.success(
|
||||
requireContext(),
|
||||
requireActivity().findViewById(android.R.id.content),
|
||||
getString(R.string.settingsSave));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
binding.indentationChipGroup.setOnCheckedStateChangeListener(
|
||||
(group, checkedIds) -> {
|
||||
if (checkedIds.size() == 1) {
|
||||
int newSelection = getIndentationChipPosition(checkedIds.get(0));
|
||||
if (newSelection != indentationSelectedChoice) {
|
||||
indentationSelectedChoice = newSelection;
|
||||
AppDatabaseSettings.updateSettingsValue(
|
||||
requireContext(),
|
||||
String.valueOf(newSelection),
|
||||
AppDatabaseSettings.APP_CE_INDENTATION_KEY);
|
||||
updateTabsWidthVisibility();
|
||||
SettingsFragment.refreshParent = true;
|
||||
SnackBar.success(
|
||||
requireContext(),
|
||||
requireActivity().findViewById(android.R.id.content),
|
||||
getString(R.string.settingsSave));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
binding.indentationTabsChipGroup.setOnCheckedStateChangeListener(
|
||||
(group, checkedIds) -> {
|
||||
if (checkedIds.size() == 1) {
|
||||
int newSelection = getIndentationTabsChipPosition(checkedIds.get(0));
|
||||
if (newSelection != indentationTabsSelectedChoice) {
|
||||
indentationTabsSelectedChoice = newSelection;
|
||||
AppDatabaseSettings.updateSettingsValue(
|
||||
requireContext(),
|
||||
String.valueOf(newSelection),
|
||||
AppDatabaseSettings.APP_CE_TABS_WIDTH_KEY);
|
||||
SettingsFragment.refreshParent = true;
|
||||
SnackBar.success(
|
||||
requireContext(),
|
||||
requireActivity().findViewById(android.R.id.content),
|
||||
getString(R.string.settingsSave));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void setColorChipSelection(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
binding.chipColorDark.setChecked(true);
|
||||
break;
|
||||
case 1:
|
||||
binding.chipColorLight.setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private int getColorChipPosition(int checkedId) {
|
||||
if (checkedId == R.id.chipColorDark) return 0;
|
||||
if (checkedId == R.id.chipColorLight) return 1;
|
||||
return colorSelectedChoice;
|
||||
}
|
||||
|
||||
private void setIndentationChipSelection(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
binding.chipIndentSpaces.setChecked(true);
|
||||
break;
|
||||
case 1:
|
||||
binding.chipIndentTabs.setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private int getIndentationChipPosition(int checkedId) {
|
||||
if (checkedId == R.id.chipIndentSpaces) return 0;
|
||||
if (checkedId == R.id.chipIndentTabs) return 1;
|
||||
return indentationSelectedChoice;
|
||||
}
|
||||
|
||||
private void setIndentationTabsChipSelection(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
binding.chipTabs2.setChecked(true);
|
||||
break;
|
||||
case 1:
|
||||
binding.chipTabs4.setChecked(true);
|
||||
break;
|
||||
case 2:
|
||||
binding.chipTabs6.setChecked(true);
|
||||
break;
|
||||
case 3:
|
||||
binding.chipTabs8.setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private int getIndentationTabsChipPosition(int checkedId) {
|
||||
if (checkedId == R.id.chipTabs2) return 0;
|
||||
if (checkedId == R.id.chipTabs4) return 1;
|
||||
if (checkedId == R.id.chipTabs6) return 2;
|
||||
if (checkedId == R.id.chipTabs8) return 3;
|
||||
return indentationTabsSelectedChoice;
|
||||
}
|
||||
|
||||
private void updateTabsWidthVisibility() {
|
||||
boolean isTabsSelected =
|
||||
indentationList[indentationSelectedChoice].startsWith(
|
||||
getString(R.string.ceIndentationTabs));
|
||||
binding.indentationTabsSelectionFrame.setVisibility(
|
||||
isTabsSelected ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.SettingsAppearanceActivity;
|
||||
import org.mian.gitnex.activities.SettingsCodeEditorActivity;
|
||||
import org.mian.gitnex.activities.SettingsGeneralActivity;
|
||||
import org.mian.gitnex.activities.SettingsSecurityActivity;
|
||||
import org.mian.gitnex.databinding.FragmentSettingsBinding;
|
||||
@@ -47,7 +46,12 @@ public class SettingsFragment extends Fragment {
|
||||
v1 -> startActivity(new Intent(ctx, SettingsAppearanceActivity.class)));
|
||||
|
||||
fragmentSettingsBinding.codeEditorFrame.setOnClickListener(
|
||||
v1 -> startActivity(new Intent(ctx, SettingsCodeEditorActivity.class)));
|
||||
v1 ->
|
||||
new BottomSheetSettingsCodeEditorFragment()
|
||||
.show(getChildFragmentManager(), "BottomSheetSettingsCodeEditor"));
|
||||
|
||||
/*fragmentSettingsBinding.codeEditorFrame.setOnClickListener(
|
||||
v1 -> startActivity(new Intent(ctx, SettingsCodeEditorActivity.class)));*/
|
||||
|
||||
fragmentSettingsBinding.securityFrame.setOnClickListener(
|
||||
v1 -> startActivity(new Intent(ctx, SettingsSecurityActivity.class)));
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
style="?attr/collapsingToolbarLayoutLargeStyle"
|
||||
android:layout_width="match_parent"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
app:contentScrim="?attr/primaryBackgroundColor"
|
||||
android:layout_height="?attr/collapsingToolbarLayoutLargeSize">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/topAppBar"
|
||||
android:layout_width="match_parent"
|
||||
android:elevation="0dp"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:title="@string/codeEditor"
|
||||
app:layout_collapseMode="pin"
|
||||
app:navigationIcon="@drawable/ic_close" />
|
||||
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ceColorSelectionFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ceColorHeaderSelector"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceSyntaxHighlightColor"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen18sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ceColorSelected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/themeSelectionSelectedText"
|
||||
android:textColor="?attr/selectedTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/indentationSelectionFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen32dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/indentationHeaderSelector"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentation"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/indentationSelected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settingsThemeTimeSelectedHint"
|
||||
android:textColor="?attr/selectedTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/indentationTabsSelectionFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen32dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/indentationTabsHeaderSelector"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentationTabsWidth"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/indentationTabsSelected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settingsThemeTimeSelectedHint"
|
||||
android:textColor="?attr/selectedTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
189
app/src/main/res/layout/bottom_sheet_settings_code_editor.xml
Normal file
189
app/src/main/res/layout/bottom_sheet_settings_code_editor.xml
Normal file
@@ -0,0 +1,189 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dimen6dp"
|
||||
android:paddingBottom="@dimen/dimen12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/headerFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/codeEditor"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen18sp"/>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="@dimen/dimen28dp"
|
||||
android:layout_height="@dimen/dimen4dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen16dp"
|
||||
app:cardCornerRadius="@dimen/dimen24dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/fabColor" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ceColorSelectionFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dimen16dp"
|
||||
android:paddingEnd="@dimen/dimen16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ceColorHeaderSelector"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceSyntaxHighlightColor"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/ceColorChipGroup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipColorDark"
|
||||
style="@style/CustomChipFilter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceColorFive" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipColorLight"
|
||||
style="@style/CustomChipFilter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceColorBlueMoon" />
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/indentationSelectionFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen24dp"
|
||||
android:paddingStart="@dimen/dimen16dp"
|
||||
android:paddingEnd="@dimen/dimen16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/indentationHeaderSelector"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentation"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/indentationChipGroup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipIndentSpaces"
|
||||
style="@style/CustomChipFilter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentationSpaces" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipIndentTabs"
|
||||
style="@style/CustomChipFilter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentationTabs" />
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/indentationTabsSelectionFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen24dp"
|
||||
android:paddingStart="@dimen/dimen16dp"
|
||||
android:paddingEnd="@dimen/dimen16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/indentationTabsHeaderSelector"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentationTabsWidth"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen16sp" />
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/indentationTabsChipGroup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipTabs2"
|
||||
style="@style/CustomChipFilter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentationTabsWidth2" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipTabs4"
|
||||
style="@style/CustomChipFilter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentationTabsWidth4" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipTabs6"
|
||||
style="@style/CustomChipFilter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentationTabsWidth6" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chipTabs8"
|
||||
style="@style/CustomChipFilter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ceIndentationTabsWidth8" />
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -97,20 +97,20 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="ceColors">
|
||||
<item>Five O Clock</item>
|
||||
<item>Blue Moon</item>
|
||||
<item>@string/ceColorFive</item>
|
||||
<item>@string/ceColorBlueMoon</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="ceIndentation">
|
||||
<item>Tabs</item>
|
||||
<item>Spaces</item>
|
||||
<item>@string/ceIndentationSpaces</item>
|
||||
<item>@string/ceIndentationTabs</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="ceIndentationTabsWidth">
|
||||
<item>2</item>
|
||||
<item>4</item>
|
||||
<item>6</item>
|
||||
<item>8</item>
|
||||
<item>@string/ceIndentationTabsWidth2</item>
|
||||
<item>@string/ceIndentationTabsWidth4</item>
|
||||
<item>@string/ceIndentationTabsWidth6</item>
|
||||
<item>@string/ceIndentationTabsWidth8</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="fragmentTabsAnimation">
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
<string name="feedbackText" translatable="false">Feedback</string>
|
||||
<string name="where_to_get_token_text" translatable="false"><u>Where can I get an access token?</u></string>
|
||||
<string name="where_to_get_token_message" translatable="false"><![CDATA[<br>• Log in to your account on your instance (Codeberg, etc.).<br>• Click on your user profile picture, then go to Settings.<br>• Under Applications, create a token with a name of your choice.<br>• Choose All (public, private, and limited).<br>• Under Select permissions, select Read and write for each dropdown.<br><br> Once created, copy and paste or type the token here along with the instance URL.]]></string>
|
||||
<string name="ceColorFive" translatable="false">Five O Clock</string>
|
||||
<string name="ceColorBlueMoon" translatable="false">Blue Moon</string>
|
||||
<string name="ceIndentationTabs" translatable="false">Tabs</string>
|
||||
<string name="ceIndentationSpaces" translatable="false">Spaces</string>
|
||||
<string name="ceIndentationTabsWidth2" translatable="false">2</string>
|
||||
<string name="ceIndentationTabsWidth4" translatable="false">4</string>
|
||||
<string name="ceIndentationTabsWidth6" translatable="false">6</string>
|
||||
<string name="ceIndentationTabsWidth8" translatable="false">8</string>
|
||||
|
||||
<!-- menu items -->
|
||||
<string name="navMyRepos">My Repositories</string>
|
||||
|
||||
Reference in New Issue
Block a user