some cleanup and translation

This commit is contained in:
JG-Cody 2021-07-10 16:01:02 +02:00
parent 8ecc32829b
commit ca19e0fc09
8 changed files with 45 additions and 86 deletions

View File

@ -385,7 +385,7 @@ public class MainActivity extends AppCompatActivity {
transaction.replace(R.id.nav_host_fragment, pef).setPrimaryNavigationFragment(pef);
transaction.addToBackStack(null);
transaction.commit();
Objects.requireNonNull(getSupportActionBar()).setTitle(R.string.menu_einstellungen);
Objects.requireNonNull(getSupportActionBar()).setTitle(R.string.menu_settings);
}
public void menurighttopcredits(MenuItem i) {
@ -394,7 +394,7 @@ public class MainActivity extends AppCompatActivity {
transaction.replace(R.id.nav_host_fragment, pef).setPrimaryNavigationFragment(pef);
transaction.addToBackStack(null);
transaction.commit();
Objects.requireNonNull(getSupportActionBar()).setTitle(R.string.menu_über);
Objects.requireNonNull(getSupportActionBar()).setTitle(R.string.menu_about);
}
public void menurighttopdocumentation(MenuItem i) {

View File

@ -23,8 +23,6 @@ import androidx.annotation.RequiresApi;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import com.rarepebble.colorpicker.ColorPickerView;
import java.util.Base64;
import java.util.Locale;
import java.util.Objects;
@ -200,46 +198,17 @@ public class EinstellungenFragment extends Fragment {
}
private void showChangeBackgroundDialog() {
final String[] listItems = {"FARBE", "GRADIENT", "GRAFIK", "RESET BACKGROUND"};
final String[] listItems = {"GRAFIK", "RESET BACKGROUND"};
AlertDialog.Builder mBuilder = new AlertDialog.Builder(getContext());
mBuilder.setTitle("CHOOSE BACKGROUND-TYPE");
mBuilder.setSingleChoiceItems(listItems, -5, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (i == 0) {
try {
final ColorPickerView picker = new ColorPickerView(getContext());
picker.setColor(0xff12345);
AlertDialog mDialog = new AlertDialog.Builder(getContext()).setView(picker).setTitle(R.string.colorpicker).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).create();
Objects.requireNonNull(mDialog.getWindow()).setBackgroundDrawableResource(R.drawable.button_round);
mDialog.show();
} catch (Exception e) {
}
} else if (i == 1) {
try {
final ColorPickerView picker = new ColorPickerView(getContext());
picker.setColor(0xff12345);
AlertDialog mDialog = new AlertDialog.Builder(getContext()).setView(picker).setTitle(R.string.colorpicker).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).create();
Objects.requireNonNull(mDialog.getWindow()).setBackgroundDrawableResource(R.drawable.button_round);
mDialog.show();
} catch (Exception ignored) {
}
} else if (i == 2) {
Intent a = new Intent(
Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
requireActivity().startActivityForResult(a, MainActivity.RESULT_LOAD_IMAGE);
} else if (i == 3) {
} else if (i == 1) {
requireContext().getSharedPreferences("appsettings", Context.MODE_PRIVATE).edit().remove("Background").apply();
startActivity(requireActivity().getIntent());
requireActivity().finish();

View File

@ -22,8 +22,9 @@
app:layout_constraintVertical_bias="0.0" />
<ListView
android:layout_width="413dp"
android:layout_height="729dp"
tools:layout_editor_absoluteX="-1dp"
tools:layout_editor_absoluteY="2dp" />
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -7,7 +7,7 @@
android:icon="@drawable/contact_support_black_24dp"
android:onClick="menurighttopdocumentation"
android:orderInCategory="100"
android:title="@string/menu_frage"
android:title="@string/menu_documentation"
app:iconTint="?attr/colorOnPrimary"
app:showAsAction="ifRoom" />
<item
@ -15,20 +15,20 @@
android:icon="@drawable/ic_menu_share"
android:onClick="menurighttopeinstellungen"
android:orderInCategory="100"
android:title="@string/menu_einstellungen"
android:title="@string/menu_settings"
app:showAsAction="never" />
<item
android:id="@+id/über"
android:onClick="menurighttopcredits"
android:orderInCategory="100"
android:title="@string/menu_über"
android:title="@string/menu_about"
app:showAsAction="never" />
<item
android:id="@+id/exit"
android:icon="@drawable/logout_24px"
android:onClick="menurighttopschliessen"
android:orderInCategory="100"
android:title="@string/menu_schliessen"
android:title="@string/menu_close"
app:iconTint="?attr/colorOnPrimary"
app:showAsAction="ifRoom" />
</menu>

View File

@ -21,7 +21,7 @@
<fragment
android:id="@+id/nav_einstellungen"
android:name="de.jg_cody.Teraplex.ui.Einstellungen.EinstellungenFragment"
android:label="@string/menu_einstellungen"
android:label="@string/menu_settings"
tools:layout="@layout/fragment_einstellungen" />
<fragment
@ -51,6 +51,6 @@
<fragment
android:id="@+id/nav_über"
android:name="de.jg_cody.Teraplex.ui.Credits.CreditsFragment"
android:label="@string/menu_über"
android:label="@string/menu_about"
tools:layout="@layout/fragment_credits" />
</navigation>

View File

@ -14,12 +14,11 @@
<string name="menu_schlafzimmer">SCHLAFZIMMER</string>
<string name="menu_flur">FLUR</string>
<string name="menu_küche">KÜCHE</string>
<string name="menu_einstellungen">EINSTELLUNGEN</string>
<string name="menu_frage">FRAGE</string>
<string name="menu_credits">CREDITS</string>
<string name="menu_settings">EINSTELLUNGEN</string>
<string name="menu_documentation">FRAGE</string>
<string name="menu_logout">AUSLOGGEN</string>
<string name="menu_sprache">SPRACHE</string>
<string name="menu_schliessen">SCHLIESSEN</string>
<string name="menu_language">SPRACHE</string>
<string name="menu_close">SCHLIESSEN</string>
<string name="colorpicker">WÄHLE DEINE FARBE</string>
<string name="ok">WEITER</string>
<string name="action_logout">AUSLOGGEN</string>
@ -41,11 +40,6 @@
<string name="hintergrund">HINTERGRUND</string>
<string name="sprache">SPRACHE</string>
<string name="einstellungen_zurücksetzen">EINSTELLUNGEN ZURÜCKSETZEN</string>
<string name="farbschema">FARBSCHEMA</string>
<string name="blau">BLAU</string>
<string name="rot">ROT</string>
<string name="grün">GRÜN</string>
<string name="gelb">GELB</string>
<string name="button_zurücksetzen">ZURÜCKSETZEN</string>
<string name="button_hintergrund_wählen">HINTERGRUND WÄHLEN</string>
<string name="ssh_remote">SSH-FERNBEDIENUNG</string>
@ -55,5 +49,21 @@
<string name="logout">AUSLOGGEN</string>
<string name="are_you_sure_to_reset">MÖCHTEST DU WIRKLICH DIE APP UND ALLE IHRE EINSTELLUNGEN ZURÜCKSETZEN?</string>
<string name="reset_app">APP ZURÜCKSETZEN</string>
<string name="menu_über">ABOUT</string>
<string name="menu_about">ABOUT</string>
<string name="login_saved">LOGIN_DATEN GESPEICHERT</string>
<string name="felder_dürfen_nicht_leer_sein">FELDER DÜRFEN NICHT LEER SEIN!</string>
<string name="themes">FARBSCHEMA</string>
<string name="red_blue">ROT BLAU</string>
<string name="green_yellow">GRÜN GELB</string>
<string name="orange_turquoise">ORANGE TÜRKIS</string>
<string name="yellow_blue">GELB BLAU</string>
<string name="pink_green">PINK GRÜN</string>
<string name="version">TERAPLEX v1.1.1</string>
<string name="licence">LIZENZ</string>
<string name="contact">KONTAKT</string>
<string name="appcode">APPCODE</string>
<string name="team">TEAM</string>
<string name="cooperation">IN KOOPERATION MIT</string>
<string name="menu_add">TAB HINZUFÜGEN</string>
<string name="menu_remove">TABS ENTFERNEN</string>
</resources>

View File

@ -10,14 +10,13 @@
<string name="menu_schlafzimmer">pum</string>
<string name="menu_flur">vaS</string>
<string name="menu_küche">qeylIS</string>
<string name="menu_einstellungen">\'Iv</string>
<string name="menu_frage">yu\'</string>
<string name="menu_sprache">Hol</string>
<string name="menu_schliessen">SoQmoH</string>
<string name="menu_settings">\'Iv</string>
<string name="menu_documentation">yu\'</string>
<string name="menu_language">Hol</string>
<string name="menu_close">SoQmoH</string>
<string name="colorpicker">bIrchoH</string>
<string name="ok">lu\'</string>
<string name="menu_logout">parmaq</string>
<string name="menu_credits">QeH</string>
<string name="action_logout">parmaq</string>
<string name="Welcome_to_your_HOMEAUTOMATION_APP">BATLH BIMEJNIS</string>
<string name="login">QONOS</string>
@ -37,11 +36,6 @@
<string name="hintergrund">chech</string>
<string name="sprache">Hol</string>
<string name="einstellungen_zurücksetzen">qem</string>
<string name="farbschema">naH</string>
<string name="blau">SuD</string>
<string name="rot">qe\'</string>
<string name="grün">wIgh</string>
<string name="gelb">DeQ</string>
<string name="button_hintergrund_wählen">nobHa\'</string>
<string name="button_zurücksetzen">lI\'</string>
<string name="ssh_remote">verengan</string>

View File

@ -74,29 +74,14 @@
<string name="menu_add">ADD TAB</string>
<string name="menu_remove">REMOVE TABS</string>
<string name="menu_einstellungen">SETTINGS</string>
<string name="menu_frage">QUESTION</string>
<string name="menu_über">ÜBER</string>
<string name="menu_settings">SETTINGS</string>
<string name="menu_documentation">QUESTION</string>
<string name="menu_about">ABOUT</string>
<string name="menu_logout">LOGOUT</string>
<string name="menu_sprache">LANGUAGE</string>
<string name="menu_schliessen">CLOSE</string>
<string name="menu_language">LANGUAGE</string>
<string name="menu_close">CLOSE</string>
<string name="colorpicker">CHOOSE YOUR COLOR</string>
<string name="ok">OK</string>
<string-array name="theme_array">
<item>RED</item>
<item>GREEN</item>
<item>BLUE</item>
<item>Dark</item>
</string-array>
<string-array name="language_array">
<item>GERMAN</item>
<item>ENGLISH</item>
<item>KLINGONISCH</item>
</string-array>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>