Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
KenMizz committed Dec 2, 2020
1 parent 9db3935 commit e4ed9cf
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 27 deletions.
8 changes: 2 additions & 6 deletions app/src/main/java/kenmizz/onesentence/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void onClick(DialogInterface dialog, int which) {
.show();
}

@SuppressLint({"InflateParams", "NonConstantResourceId"})
@SuppressLint({"InflateParams", "NonConstantResourceId", "SetTextI18n"})
public void showAppDialog(int layoutId) {
MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(this);
final View view = getLayoutInflater().inflate(layoutId, null);
Expand All @@ -155,7 +155,7 @@ public void showAppDialog(int layoutId) {
.setPositiveButton(R.string.ok, null)
.show();
TextView textView = view.findViewById(R.id.versionName);
textView.setText(BuildConfig.VERSION_NAME);
textView.setText(getString(R.string.current_version) + "v" + BuildConfig.VERSION_NAME);
break;


Expand All @@ -178,10 +178,6 @@ public void onClick(DialogInterface dialogInterface, int i) {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
switch (radioGroup.getCheckedRadioButtonId()) {
default:
newthemeOptions = NIGHTMODE.DEFAULT.ordinal();
break;

case R.id.follow_system:
newthemeOptions = NIGHTMODE.DEFAULT.ordinal();
break;
Expand Down
30 changes: 24 additions & 6 deletions app/src/main/res/layout/about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,40 @@
android:contentDescription="@string/app_name"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.176"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.16"
app:layout_constraintVertical_bias="0.276"
app:srcCompat="@drawable/app_icon_around" />

<TextView
android:id="@+id/versionName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/appIconView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appIconView"
app:layout_constraintVertical_bias="0.051" />
app:layout_constraintHorizontal_bias="0.25"
app:layout_constraintStart_toEndOf="@+id/appIconView"
app:layout_constraintTop_toTopOf="@+id/appIconView"
app:layout_constraintVertical_bias="0.187" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:text="@string/author_name"
app:layout_constraintStart_toEndOf="@+id/appIconView"
app:layout_constraintTop_toBottomOf="@+id/versionName" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
app:layout_constraintEnd_toEndOf="@+id/appIconView"
app:layout_constraintStart_toStartOf="@+id/appIconView"
app:layout_constraintTop_toBottomOf="@+id/appIconView" />



</androidx.constraintlayout.widget.ConstraintLayout>
39 changes: 24 additions & 15 deletions app/src/main/res/layout/sentence_edittext.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.textfield.TextInputLayout 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="match_parent"
android:hint="@string/sentence"
android:layout_marginStart="30dp"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="333dp"
android:layout_height="53dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:gravity="center"
app:boxStrokeColor="?attr/colorOnSurface"
app:hintTextColor="?attr/colorOnSurface"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
xmlns:app="http://schemas.android.com/apk/res-auto">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/SentenceAddEditText"
android:layout_width="339dp"
android:layout_height="wrap_content" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="@string/sentence"
app:boxStrokeColor="?attr/colorOnSurface"
app:hintTextColor="?attr/colorOnSurface"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.325">

</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/SentenceAddEditText"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@
<string name="sentence_size">句子大小:</string>
<string name="sentence_color">句子颜色:</string>
<string name="change_success">成功设置</string>
<string name="current_version">"当前版本: "</string>
<string name="author_name">作者:平凡的芝士</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@
<string name="sentence_size">Sentence Size:</string>
<string name="sentence_color">Sentence Color:</string>
<string name="change_success">Apply changes successful!</string>
<string name="current_version">Current version:</string>
<string name="author_name">Made by KenMizz</string>
</resources>

0 comments on commit e4ed9cf

Please sign in to comment.