zusammenkopiert aus Teraplex und CodeGuard
This commit is contained in:
parent
5796a4519e
commit
3d74d80b7a
@ -1,12 +1,21 @@
|
|||||||
package com.example.onetap_ssh;
|
package com.example.onetap_ssh;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
|
||||||
|
import com.example.onetap_ssh.fragment.AboutFragment;
|
||||||
|
import com.example.onetap_ssh.fragment.SettingsFragment;
|
||||||
|
import com.example.onetap_ssh.util.DialogUtil;
|
||||||
|
import com.example.onetap_ssh.util.NavigationUtil;
|
||||||
|
import com.example.onetap_ssh.util.SettingsUtil;
|
||||||
|
import com.example.onetap_ssh.util.ThemeUtil;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.google.android.material.navigation.NavigationView;
|
import com.google.android.material.navigation.NavigationView;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.navigation.NavController;
|
import androidx.navigation.NavController;
|
||||||
import androidx.navigation.Navigation;
|
import androidx.navigation.Navigation;
|
||||||
import androidx.navigation.ui.AppBarConfiguration;
|
import androidx.navigation.ui.AppBarConfiguration;
|
||||||
@ -16,11 +25,17 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
|
|
||||||
import com.example.onetap_ssh.databinding.ActivityMainBinding;
|
import com.example.onetap_ssh.databinding.ActivityMainBinding;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private AppBarConfiguration mAppBarConfiguration;
|
private AppBarConfiguration mAppBarConfiguration;
|
||||||
private ActivityMainBinding binding;
|
private ActivityMainBinding binding;
|
||||||
|
|
||||||
|
private boolean fullyLaunched;
|
||||||
|
|
||||||
|
private boolean lockOnStop = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -41,18 +56,20 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
// Passing each menu ID as a set of Ids because each
|
// Passing each menu ID as a set of Ids because each
|
||||||
// menu should be considered as top level destinations.
|
// menu should be considered as top level destinations.
|
||||||
mAppBarConfiguration = new AppBarConfiguration.Builder(
|
mAppBarConfiguration = new AppBarConfiguration.Builder(
|
||||||
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
|
R.id.nav_home, R.id.nav_settings, R.id.nav_about)
|
||||||
.setOpenableLayout(drawer)
|
.setOpenableLayout(drawer)
|
||||||
.build();
|
.build();
|
||||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||||
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
||||||
NavigationUI.setupWithNavController(navigationView, navController);
|
NavigationUI.setupWithNavController(navigationView, navController);
|
||||||
|
|
||||||
|
launchApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
getMenuInflater().inflate(R.menu.main, menu);
|
getMenuInflater().inflate(R.menu.menu_main, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,4 +79,44 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|
||||||
|| super.onSupportNavigateUp();
|
|| super.onSupportNavigateUp();
|
||||||
}
|
}
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
if (id == R.id.action_settings) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
public void openSettings(MenuItem item) {
|
||||||
|
NavigationUtil.navigate(this, SettingsFragment.class, null);
|
||||||
|
}
|
||||||
|
public void openAbout(MenuItem item) {
|
||||||
|
NavigationUtil.navigate(this, AboutFragment.class, null);
|
||||||
|
}
|
||||||
|
public void lockApp(MenuItem item) {
|
||||||
|
|
||||||
|
}
|
||||||
|
private void launchApp() {
|
||||||
|
fullyLaunched = true;
|
||||||
|
lockOnStop = true;
|
||||||
|
|
||||||
|
ActivityMainBinding binding = ActivityMainBinding.inflate(getLayoutInflater());
|
||||||
|
setContentView(binding.getRoot());
|
||||||
|
ThemeUtil.loadBackground(this);
|
||||||
|
|
||||||
|
|
||||||
|
if(SettingsUtil.isFirstLaunch(this) && SettingsUtil.getGroups(this).isEmpty()) {
|
||||||
|
SettingsUtil.addGroup(this, UUID.randomUUID().toString(), "My Codes");
|
||||||
|
DialogUtil.showYesNo(this, R.string.enable_encryption_title, R.string.enable_encryption_message, () -> NavigationUtil.navigate(this, SettingsFragment.class, null), null);
|
||||||
|
SettingsUtil.setFirstLaunch(this, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Fragment fragment = NavigationUtil.getCurrentFragment(this);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.example.onetap_ssh.fragment;
|
||||||
|
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
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.example.onetap_ssh.R;
|
||||||
|
import com.example.onetap_ssh.databinding.FragmentAboutBinding;
|
||||||
|
|
||||||
|
public class AboutFragment extends NamedFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return requireActivity().getString(R.string.fragment_about);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
FragmentAboutBinding binding = FragmentAboutBinding.inflate(inflater);
|
||||||
|
try {
|
||||||
|
PackageManager manager = requireContext().getPackageManager();
|
||||||
|
PackageInfo info = manager.getPackageInfo(requireContext().getPackageName(), 0);
|
||||||
|
String version = info.versionName;
|
||||||
|
binding.appVersion.setText(version);
|
||||||
|
} catch (PackageManager.NameNotFoundException ignored) {}
|
||||||
|
return binding.getRoot();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package com.example.onetap_ssh.util;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
|
import com.example.onetap_ssh.R;
|
||||||
|
//import com.example.onetap_ssh.fragment.MenuDrawerFragment;
|
||||||
|
import com.example.onetap_ssh.fragment.NamedFragment;
|
||||||
|
|
||||||
|
public class NavigationUtil {
|
||||||
|
|
||||||
|
private static void updateActivity(AppCompatActivity activity, NamedFragment newFragment) {
|
||||||
|
ActionBar bar = activity.getSupportActionBar();
|
||||||
|
if(newFragment == null) newFragment = (NamedFragment) getCurrentFragment(activity.getSupportFragmentManager());
|
||||||
|
if(bar != null) bar.setTitle(newFragment.getName());
|
||||||
|
activity.invalidateMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void navigate(AppCompatActivity activity, NamedFragment fragment) {
|
||||||
|
FragmentManager manager = activity.getSupportFragmentManager();
|
||||||
|
navigate(manager, fragment, () -> updateActivity(activity, fragment));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void navigate(AppCompatActivity activity, Class<? extends NamedFragment> fragmentClass, Bundle args) {
|
||||||
|
FragmentManager manager = activity.getSupportFragmentManager();
|
||||||
|
NamedFragment fragment = instantiateFragment(manager, fragmentClass, args);
|
||||||
|
navigate(activity, fragment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void navigate(Fragment currentFragment, Class<? extends NamedFragment> fragmentClass, Bundle args) {
|
||||||
|
navigate((AppCompatActivity) currentFragment.requireActivity(), fragmentClass, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void openOverlay(AppCompatActivity activity, NamedFragment overlay) {
|
||||||
|
FragmentManager manager = activity.getSupportFragmentManager();
|
||||||
|
manager.beginTransaction()
|
||||||
|
.setReorderingAllowed(true)
|
||||||
|
.add(R.id.nav_host_fragment_content_main, overlay)
|
||||||
|
.runOnCommit(() -> updateActivity(activity, overlay))
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void openOverlay(Fragment currentFragment, NamedFragment overlay) {
|
||||||
|
AppCompatActivity activity = (AppCompatActivity) currentFragment.requireActivity();
|
||||||
|
openOverlay(activity, overlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void closeOverlay(Fragment currentFragment) {
|
||||||
|
AppCompatActivity activity = (AppCompatActivity) currentFragment.requireActivity();
|
||||||
|
FragmentManager manager = activity.getSupportFragmentManager();
|
||||||
|
manager.beginTransaction()
|
||||||
|
.setReorderingAllowed(true)
|
||||||
|
.remove(currentFragment)
|
||||||
|
.runOnCommit(() -> updateActivity(activity, null))
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private static <T extends Fragment> T instantiateFragment(FragmentManager manager, Class<? extends T> fragmentClass, Bundle args) {
|
||||||
|
T fragment = (T) manager.getFragmentFactory().instantiate(ClassLoader.getSystemClassLoader(), fragmentClass.getName());
|
||||||
|
if(args != null) fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void navigate(FragmentManager manager, Fragment fragment, Runnable onCommit) {
|
||||||
|
manager.beginTransaction()
|
||||||
|
.setReorderingAllowed(true)
|
||||||
|
.replace(R.id.nav_host_fragment_content_main, fragment)
|
||||||
|
.runOnCommit(onCommit)
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Fragment getCurrentFragment(AppCompatActivity activity) {
|
||||||
|
return getCurrentFragment(activity.getSupportFragmentManager());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Fragment getCurrentFragment(FragmentManager manager) {
|
||||||
|
return manager.findFragmentById(R.id.nav_host_fragment_content_main);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -203,7 +203,7 @@ public class SettingsUtil {
|
|||||||
try {
|
try {
|
||||||
return Theme.valueOf(themeId);
|
return Theme.valueOf(themeId);
|
||||||
}catch(IllegalArgumentException e) {
|
}catch(IllegalArgumentException e) {
|
||||||
return Theme.BLUE_GREEN;
|
return Theme.RED_BLUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
app/src/main/res/drawable/add_black_24dp.xml
Normal file
9
app/src/main/res/drawable/add_black_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</vector>
|
39
app/src/main/res/drawable/button_round.xml
Normal file
39
app/src/main/res/drawable/button_round.xml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<stroke
|
||||||
|
android:width="0dp"
|
||||||
|
android:color="#FFFFFF" />
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:endColor="?attr/colorPrimary"
|
||||||
|
android:startColor="?attr/colorSecondary" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="20dp"
|
||||||
|
android:bottomRightRadius="20dp"
|
||||||
|
android:topLeftRadius="20dp"
|
||||||
|
android:topRightRadius="20dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item
|
||||||
|
android:bottom="2dp"
|
||||||
|
android:left="0dp"
|
||||||
|
android:right="0dp"
|
||||||
|
android:top="0dp">
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<stroke
|
||||||
|
android:width="0dp"
|
||||||
|
android:color="#FFFFFF" />
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:endColor="?attr/colorOnBackground"
|
||||||
|
android:startColor="?attr/colorOnBackground" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="20dp"
|
||||||
|
android:bottomRightRadius="20dp"
|
||||||
|
android:topLeftRadius="20dp"
|
||||||
|
android:topRightRadius="20dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
9
app/src/main/res/drawable/code_black_24dp.xml
Normal file
9
app/src/main/res/drawable/code_black_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/home_black_24dp.xml
Normal file
9
app/src/main/res/drawable/home_black_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12,5.69l5,4.5V18h-2v-6H9v6H7v-7.81l5,-4.5M12,3L2,12h3v8h6v-6h2v6h6v-8h3L12,3z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/login_24px.xml
Normal file
9
app/src/main/res/drawable/login_24px.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5,-5L11,7zM20,19h-8v2h8c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2h-8v2h8V19z"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/logout_24px.xml
Normal file
9
app/src/main/res/drawable/logout_24px.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M17,7l-1.41,1.41L18.17,11H8v2h10.17l-2.58,2.58L17,17l5,-5zM4,5h8V3H4c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h8v-2H4V5z"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/mode_edit_black_24dp.xml
Normal file
9
app/src/main/res/drawable/mode_edit_black_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/power_settings_new_24px.xml
Normal file
9
app/src/main/res/drawable/power_settings_new_24px.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M13,3h-2v10h2L13,3zM17.83,5.17l-1.42,1.42C17.99,7.86 19,9.81 19,12c0,3.87 -3.13,7 -7,7s-7,-3.13 -7,-7c0,-2.19 1.01,-4.14 2.58,-5.42L6.17,5.17C4.23,6.82 3,9.26 3,12c0,4.97 4.03,9 9,9s9,-4.03 9,-9c0,-2.74 -1.23,-5.18 -3.17,-6.83z"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/remove_black_24dp.xml
Normal file
9
app/src/main/res/drawable/remove_black_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M19,13H5v-2h14v2z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</vector>
|
12
app/src/main/res/drawable/restart_alt_24px.xml
Normal file
12
app/src/main/res/drawable/restart_alt_24px.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M12,5V2L8,6l4,4V7c3.31,0 6,2.69 6,6c0,2.97 -2.17,5.43 -5,5.91v2.02c3.95,-0.49 7,-3.85 7,-7.93C20,8.58 16.42,5 12,5z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M6,13c0,-1.65 0.67,-3.15 1.76,-4.24L6.34,7.34C4.9,8.79 4,10.79 4,13c0,4.08 3.05,7.44 7,7.93v-2.02C8.17,18.43 6,15.97 6,13z"/>
|
||||||
|
</vector>
|
58
app/src/main/res/drawable/teraplex_logo.xml
Normal file
58
app/src/main/res/drawable/teraplex_logo.xml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="750dp"
|
||||||
|
android:height="250dp"
|
||||||
|
android:viewportWidth="750"
|
||||||
|
android:viewportHeight="250">
|
||||||
|
<path
|
||||||
|
android:pathData="M322.3,24.3c-1.8,2.9 -3.3,5.8 -3.3,6.4 0,0.7 -0.4,1.3 -0.9,1.3 -0.5,-0 -1.4,1.2 -2,2.7 -1.1,3 -5.2,10.5 -6.2,11.3 -1,0.8 -6.8,11.2 -8.6,15.2 -0.9,2.1 -2,3.8 -2.4,3.8 -0.4,-0 -1.3,1.6 -1.9,3.5 -0.6,1.9 -1.5,3.5 -2,3.5 -0.4,-0 -1.3,1.5 -2.1,3.2 -0.7,1.8 -2.7,5.5 -4.4,8.3 -3.9,6.2 -10,16.5 -10.9,18.5 -0.4,0.8 -2,3.7 -3.6,6.5 -1.7,2.7 -3.3,5.8 -3.6,6.7 -0.4,1 -1.1,1.8 -1.6,1.8 -0.5,-0 -0.8,0.6 -0.5,1.2 0.3,1 9.3,1.3 40.5,1.3 22.1,-0 40.2,-0.3 40.2,-0.8 0,-0.7 -2.4,-4.9 -5.7,-10.2 -0.7,-1.1 -2.2,-3.6 -3.2,-5.6l-2,-3.6 -17.6,0.2c-9.6,0.1 -17.5,-0.1 -17.5,-0.4 0,-0.4 0.5,-1.2 1,-1.7 1.2,-1.2 4.2,-6.2 6.8,-11.4 0.9,-1.9 2,-3.6 2.4,-3.8 0.4,-0.2 1.2,-1.9 1.8,-3.8 0.6,-1.9 1.6,-3.4 2.1,-3.4 0.5,-0 0.9,-0.4 0.9,-0.9 0,-1.4 7.1,-13.1 7.9,-13.1 0.4,-0 1.7,2.2 3,4.9 1.2,2.8 3.3,6.5 4.6,8.4 1.2,1.9 2.6,4.4 3,5.6 0.3,1.2 1.1,2.1 1.6,2.1 0.5,-0 0.9,0.6 0.9,1.3 0,0.8 1.7,4.1 3.9,7.4 2.1,3.3 4.2,7 4.6,8.2 0.3,1.1 1,2.1 1.5,2.1 0.4,-0 1.3,1.2 1.9,2.7 0.6,1.6 2.2,4.6 3.5,6.8 1.4,2.2 3.8,6.5 5.5,9.5 1.7,3 4.4,7.7 6.1,10.5 1.6,2.7 3.5,6.1 4,7.5 0.6,1.3 1.4,2.7 1.8,3 1,0.7 2.9,3.9 5.2,8.5 1.1,2.2 2.5,4.9 3.2,6 0.7,1.1 2.7,4.3 4.5,7.2 1.8,2.8 5.2,8.6 7.5,13 2.3,4.3 4.5,8 4.8,8.3 0.4,0.3 2.8,4.5 5.4,9.4 2.6,4.9 5.6,10 6.7,11.4 1,1.4 1.9,3.1 1.9,3.8 0,0.8 0.4,1.4 0.9,1.4 0.5,-0 1.4,1.2 2,2.7 0.6,1.6 2,4.1 3,5.8 1.1,1.6 2.9,4.9 4.1,7.3 2.4,4.7 3.4,4.6 5.5,-0.4 0.8,-2 2.8,-5.6 4.5,-8 1.6,-2.5 3,-4.9 3,-5.4 0,-0.5 0.6,-1.5 1.3,-2.2 1.5,-1.7 3.5,-5.1 6,-10.3 1.1,-2.2 2.2,-4.2 2.6,-4.5 0.3,-0.3 1.3,-1.9 2.1,-3.5 1.3,-2.6 2.8,-5.2 8.8,-15 0.7,-1.1 1.8,-3.1 2.4,-4.5 0.7,-1.4 3.1,-5.5 5.4,-9.1 2.3,-3.6 4.4,-7.4 4.8,-8.5 0.3,-1 2.2,-4.3 4.1,-7.2 1.9,-3 3.5,-5.7 3.5,-6 0,-0.4 1.4,-2.7 3,-5.2 1.6,-2.5 3,-5 3,-5.5 0,-0.8 -12.4,-1 -39.2,-0.9 -21.6,0.1 -39.9,0.2 -40.5,0.3 -1.6,0.1 -0.2,3.6 4.3,10.6 1.8,2.7 3.8,6.2 4.4,7.6l1.2,2.6 17.3,-0.1 17.3,-0.2 -2,4c-1.1,2.3 -2.4,4.3 -2.8,4.6 -0.4,0.3 -1,1.5 -1.4,2.7 -0.4,1.3 -1.3,2.9 -2,3.5 -0.6,0.7 -2.6,3.8 -4.2,6.8 -8.8,15.8 -9.2,16.4 -11.1,14.5 -0.7,-0.8 -2.8,-4.2 -4.6,-7.7 -4.2,-8.1 -6,-11.2 -6.8,-11.8 -0.4,-0.3 -1.8,-2.8 -3.3,-5.5 -1.4,-2.8 -3.1,-5.7 -3.6,-6.5 -0.5,-0.8 -2.9,-4.9 -5.1,-9 -2.3,-4.1 -4.5,-7.7 -4.9,-8 -0.3,-0.3 -1.3,-1.9 -2.2,-3.5 -2.7,-5.3 -5.3,-10 -5.9,-10.5 -0.3,-0.3 -1.8,-3 -3.3,-6 -1.6,-3 -3.1,-5.7 -3.5,-6 -0.3,-0.3 -1.4,-2.1 -2.4,-4 -3.9,-7.7 -5,-9.5 -5.9,-9.8 -0.4,-0.2 -0.8,-0.9 -0.8,-1.6 0,-0.8 -0.8,-2.4 -1.9,-3.7 -1,-1.3 -3.4,-5.3 -5.3,-8.9 -1.9,-3.6 -4.6,-8.3 -6,-10.5 -1.4,-2.2 -2.8,-5 -3.2,-6.3 -0.4,-1.2 -1.1,-2.2 -1.6,-2.2 -0.4,-0 -1.3,-1.2 -1.9,-2.8 -1.1,-2.9 -4.2,-8.4 -5.2,-9.2 -0.4,-0.3 -0.9,-1.4 -1.3,-2.5 -0.3,-1.1 -2.6,-5.1 -5.1,-9 -2.5,-3.8 -4.5,-7.5 -4.5,-8.2 0,-0.7 -0.4,-1.3 -0.8,-1.3 -0.4,-0 -2.1,-2.7 -3.6,-6 -1.6,-3.4 -3.2,-6.2 -3.5,-6.4 -0.3,-0.2 -2.1,1.9 -3.8,4.7z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M337,20.8c0,0.7 1.1,3 2.5,5 1.4,2 2.5,4.2 2.5,4.9 0,0.7 0.4,1.3 0.8,1.3 0.4,-0 1.3,1.2 1.9,2.7 0.7,1.6 2.6,5 4.2,7.8 1.7,2.7 3.3,5.7 3.7,6.5 0.5,0.8 2.3,3.8 4.1,6.7 1.8,2.9 3.3,5.5 3.3,5.9 0,0.6 6.3,11.5 10.1,17.4 0.5,0.8 1.2,2.3 1.5,3.2 0.4,1 1,1.8 1.4,1.8 0.4,-0 1,0.8 1.3,1.7 0.4,1 2.2,4.5 4.1,7.8 2,3.3 4,7.2 4.7,8.7 0.6,1.6 1.5,2.8 1.9,2.8 0.4,-0 1.3,1.2 1.9,2.7 1.2,3.4 4.1,8.2 6,10.3 1.2,1.2 5.8,1.5 30.3,1.5 16.5,0.1 28.8,-0.3 28.8,-0.8 0,-0.5 -1.3,-2.8 -2.8,-5.1 -1.5,-2.2 -3.1,-4.8 -3.5,-5.6 -0.5,-0.8 -1.6,-3.1 -2.6,-5l-1.9,-3.5 -17.7,-0.1c-9.7,-0.1 -17.7,-0.3 -17.9,-0.5 -0.1,-0.2 -3.3,-5.6 -7,-11.9 -3.6,-6.3 -7.1,-12.2 -7.6,-13 -0.5,-0.8 -1.7,-2.9 -2.5,-4.5 -0.8,-1.7 -2.4,-4.4 -3.5,-6 -1.1,-1.7 -2.3,-3.7 -2.6,-4.5 -0.4,-0.8 -1.3,-2.2 -1.9,-3 -0.7,-0.8 -3.4,-5.6 -6,-10.5 -2.6,-5 -5.1,-9.2 -5.6,-9.3 -0.5,-0.2 -0.9,-0.9 -0.9,-1.5 -0.1,-0.7 -2,-4.4 -4.3,-8.2l-4.2,-7 -11.2,-0.1c-8.9,-0 -11.3,0.3 -11.3,1.4z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M4.7,100.7c-0.4,0.3 -0.7,2.4 -0.7,4.5l0,3.8 11,-0 11,-0 0,19.5 0,19.5 5.5,-0 5.5,-0 0,-19.5 0,-19.4 10.8,-0.3 10.7,-0.3 0,-4 0,-4 -26.6,-0.3c-14.6,-0.1 -26.8,0.1 -27.2,0.5z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M72,124l0,24 24.3,-0.2 24.2,-0.3 0.3,-4.3 0.3,-4.2 -19,-0 -19.1,-0 0,-6 0,-6 11,-0 11,-0 0,-4 0,-4 -11,-0 -11,-0 0,-5 0,-5 18.5,-0 18.5,-0 0,-4.5 0,-4.5 -24,-0 -24,-0 0,24z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M141,124.1l0,24 5.3,-0.3 5.2,-0.3 0.3,-8.8 0.3,-8.7 5,-0c5,-0 5.2,0.1 14.7,9l9.6,9 7.4,-0c8.9,-0 9,0.3 -4,-10.2l-9,-7.3 5.7,-0.6c8.9,-1 10,-2.7 10,-14.9 0,-11.3 -0.7,-12.6 -7.1,-14 -2.1,-0.5 -12.8,-1 -23.6,-1l-19.8,-0 0,24.1zM180.8,114.5c0.5,7.1 -0.5,7.5 -16,7.5l-12.8,-0 0,-6.5 0,-6.6 14.3,0.3 14.2,0.3 0.3,5z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M226.6,103.7c-3.2,5.1 -24.6,43.1 -24.6,43.8 0,0.3 2.4,0.5 5.3,0.3 5.2,-0.3 5.2,-0.3 8,-5.6l2.8,-5.2 14.9,-0 14.9,-0 2.8,5.2 2.8,5.3 5.8,0.3c3.5,0.2 5.7,-0.1 5.7,-0.8 0,-0.5 -5.9,-11.4 -13.1,-24l-13.2,-23 -4.8,-0c-4.5,-0 -5,0.3 -7.3,3.7zM242.7,128.7c-0.3,0.2 -4.8,0.2 -10,0.1l-9.6,-0.3 5,-9.4 5.1,-9.3 5,9.2c2.7,5.1 4.7,9.4 4.5,9.7z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M493,123.9l0,24.1 5.5,-0 5.5,-0 0,-9.5 0,-9.5 17.5,-0c17.3,-0 17.6,-0 20,-2.5 2.3,-2.2 2.5,-3.2 2.5,-11.4 0,-8.1 -0.2,-9.3 -2.4,-11.8l-2.4,-2.8 -23.1,-0.3 -23.1,-0.4 0,24.1zM532.5,115l0,5.5 -14.2,0.3 -14.3,0.3 0,-6.1 0,-6.1 14.3,0.3 14.2,0.3 0,5.5z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M561,123.9l0,24.1 23,-0 23,-0 0,-4.5 0,-4.5 -17.5,-0 -17.5,-0 -0.2,-19.3 -0.3,-19.2 -5.2,-0.3 -5.3,-0.3 0,24z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M623.7,100.7c-0.4,0.3 -0.7,11.1 -0.7,24l0,23.3 24.5,-0 24.5,-0 0,-4.5 0,-4.5 -19,-0 -19,-0 0,-6 0,-6 11,-0 11,-0 0,-4 0,-4 -11,-0 -11,-0 0,-5 0,-5 18.5,-0 18.5,-0 0,-4.5 0,-4.5 -23.3,-0c-12.9,-0 -23.7,0.3 -24,0.7z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M685,100.7c0,0.4 4.9,5.7 11,11.8l11,11 -11,12 -11,12 6.2,0.3 6.2,0.3 5.1,-5.8c2.7,-3.2 6.4,-7.4 8.2,-9.3l3.2,-3.5 8.6,9.2 8.7,9.3 6.9,-0c3.8,-0 6.9,-0.3 6.9,-0.7 0,-0.4 -5.5,-6.3 -12.1,-12.9l-12.2,-12.2 9.4,-10.1c5.2,-5.6 9.6,-10.6 9.7,-11.1 0.2,-0.6 -2,-1 -5.1,-1 -5.4,-0 -5.7,0.2 -10.5,5.2 -2.7,2.9 -6.1,6.6 -7.5,8.3l-2.6,3 -7.6,-8.3 -7.7,-8.2 -6.9,-0c-3.8,-0 -6.9,0.3 -6.9,0.7z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M297,129.9c0,0.2 2.5,4.5 5.5,9.6 3,5 5.5,9.6 5.5,10.2 0,0.6 6.4,1 18,0.9l18,-0.2 1.3,2.8c0.6,1.6 1.5,2.8 1.9,2.8 0.3,-0 1.2,1.6 1.8,3.5 0.6,1.9 1.5,3.5 2,3.5 0.5,-0 1.4,1.6 2.1,3.5 0.7,1.9 1.6,3.5 2,3.5 0.4,-0 1.2,1.2 1.8,2.7 1.8,4.2 4.3,8.6 5.8,10.1 0.7,0.7 1.3,2 1.3,2.8 0,0.8 0.4,1.4 0.9,1.4 0.5,-0 1.5,1.5 2.2,3.2 0.7,1.8 2.5,5.1 3.9,7.3 4.1,6.5 4.7,7.6 8.7,15.3 2,4 4.3,7.8 5,8.4 0.7,0.6 1.3,1.7 1.3,2.4 0,0.8 0.4,1.4 1,1.4 0.5,-0 1.2,1.1 1.6,2.5 0.4,1.5 1.5,2.7 2.8,3 3.2,0.7 21.3,0.1 22.2,-0.8 0.4,-0.4 0.3,-0.7 -0.3,-0.7 -0.6,-0 -1.8,-1.7 -2.8,-3.8 -2.3,-5.2 -4.7,-9.6 -5.5,-10.2 -1.1,-0.8 -10,-16.8 -10,-18 0,-0.5 -0.4,-1 -0.8,-1 -0.5,-0 -2.1,-2.6 -3.7,-5.8 -1.5,-3.1 -3.1,-5.9 -3.4,-6.2 -0.4,-0.3 -1.2,-1.6 -1.8,-3 -0.7,-1.4 -2.4,-4.3 -3.7,-6.5 -2.3,-3.7 -7.5,-12.6 -11.8,-20.3 -4.5,-8 -5.8,-10.3 -8.1,-13.9 -1.3,-2.1 -3.1,-5.4 -4,-7.3l-1.7,-3.5 -29.5,-0c-16.2,-0 -29.5,0.2 -29.5,0.4z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M63,167.5l0,2.5 136,-0 136,-0 0,-2.5 0,-2.5 -136,-0 -136,-0 0,2.5z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M478,167.5l0,2.5 104.5,-0 104.5,-0 0,-2.5 0,-2.5 -104.5,-0 -104.5,-0 0,2.5z"
|
||||||
|
android:fillColor="#000000"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/visibility_black_24dp.xml
Normal file
9
app/src/main/res/drawable/visibility_black_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12,6c3.79,0 7.17,2.13 8.82,5.5C19.17,14.87 15.79,17 12,17s-7.17,-2.13 -8.82,-5.5C4.83,8.13 8.21,6 12,6m0,-2C7,4 2.73,7.11 1,11.5 2.73,15.89 7,19 12,19s9.27,-3.11 11,-7.5C21.27,7.11 17,4 12,4zM12,9c1.38,0 2.5,1.12 2.5,2.5S13.38,14 12,14s-2.5,-1.12 -2.5,-2.5S10.62,9 12,9m0,-2c-2.48,0 -4.5,2.02 -4.5,4.5S9.52,16 12,16s4.5,-2.02 4.5,-4.5S14.48,7 12,7z"
|
||||||
|
android:fillColor="#000000"/>
|
||||||
|
</vector>
|
@ -9,14 +9,12 @@
|
|||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/Theme.OneTap_SSH.AppBarOverlay">
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<com.google.android.material.appbar.MaterialToolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize" />
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
app:popupTheme="@style/Theme.OneTap_SSH.PopupOverlay" />
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
@ -1,22 +1,165 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:clickable="true"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:hapticFeedbackEnabled="true"
|
||||||
tools:context=".ui.home.HomeFragment">
|
tools:context=".ui.home.HomeFragment">
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:id="@+id/text_home"
|
android:id="@+id/shutdown"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="5dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:background="@drawable/button_round"
|
||||||
android:textAlignment="center"
|
android:hapticFeedbackEnabled="true"
|
||||||
android:textSize="20sp"
|
android:text="@string/shutdown"
|
||||||
|
app:backgroundTint="@null"
|
||||||
|
app:icon="@drawable/power_settings_new_24px"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/reboot" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/reboot"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/button_round"
|
||||||
|
android:hapticFeedbackEnabled="true"
|
||||||
|
android:text="@string/reboot"
|
||||||
|
app:backgroundTint="@null"
|
||||||
|
app:icon="@drawable/restart_alt_24px"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ipInput" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/Background"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="#80FFFFFF"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/background_red_blue"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_home"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="50dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/Welcome_to_your_HOMEAUTOMATION_APP"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="20sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/reboot"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/login_data"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="#00FF00"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/text_home"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/text_home"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/text_home" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ipInput"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:backgroundTint="@color/mtrl_btn_text_color_selector"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="@string/login_ipaddress"
|
||||||
|
android:inputType="text"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/text_home"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/text_home"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/login_data" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/loginuserInput"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="@color/mtrl_btn_text_color_selector"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="@string/login_username"
|
||||||
|
android:inputType="textEmailAddress"
|
||||||
|
android:singleLine="false"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/text_home"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/text_home"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ipInput" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/loginpasswordInput"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="@color/mtrl_btn_text_color_selector"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="@string/login_password"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/text_home"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/text_home"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginuserInput"
|
||||||
|
app:passwordToggleEnabled="true"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/loginButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:background="@drawable/button_round"
|
||||||
|
android:drawableLeft="@drawable/login_24px"
|
||||||
|
android:drawableTint="?android:attr/textColor"
|
||||||
|
android:hapticFeedbackEnabled="true"
|
||||||
|
android:text="@string/login"
|
||||||
|
app:backgroundTint="@null"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/text_home"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginpasswordInput" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/logoutButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:background="@drawable/button_round"
|
||||||
|
android:drawableRight="@drawable/logout_24px"
|
||||||
|
android:drawableTint="?android:attr/textColor"
|
||||||
|
android:hapticFeedbackEnabled="true"
|
||||||
|
android:text="@string/logout"
|
||||||
|
app:backgroundTint="@null"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/text_home"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginpasswordInput" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/togglepassword"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="-30dp"
|
||||||
|
android:src="@drawable/visibility_black_24dp"
|
||||||
|
app:tint="?android:attr/textColor"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/loginpasswordInput"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/loginpasswordInput"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/loginuserInput" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/nav_header_height"
|
android:layout_height="@dimen/nav_header_height"
|
||||||
android:background="@drawable/side_nav_bar"
|
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
@ -15,21 +15,25 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="80dp"
|
||||||
android:contentDescription="@string/nav_header_desc"
|
|
||||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||||
app:srcCompat="@mipmap/ic_launcher_round" />
|
android:src="@drawable/teraplex_logo"
|
||||||
|
app:tint="@color/mtrl_btn_text_color_selector"
|
||||||
|
android:contentDescription="TODO" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||||
android:text="@string/nav_header_title"
|
android:text="@string/ssh_remote"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
|
android:textColor="@color/mtrl_btn_text_color_selector" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView"
|
android:id="@+id/textView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/nav_header_subtitle" />
|
android:text="WWW.JG-CODY.DE"
|
||||||
|
android:textColor="@color/mtrl_btn_text_color_selector" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
11
app/src/main/res/layout/switch_item.xml
Normal file
11
app/src/main/res/layout/switch_item.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/switch_editmode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true" />
|
||||||
|
</RelativeLayout>
|
@ -1,20 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:showIn="navigation_view">
|
tools:showIn="navigation_view">
|
||||||
|
|
||||||
<group android:checkableBehavior="single">
|
<group
|
||||||
|
android:id="@+id/Main"
|
||||||
|
android:checkableBehavior="single"
|
||||||
|
android:orderInCategory="1">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_home"
|
android:id="@+id/nav_home"
|
||||||
android:icon="@drawable/ic_menu_camera"
|
android:icon="@drawable/home_black_24dp"
|
||||||
android:title="@string/menu_home" />
|
android:title="@string/menu_home" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_gallery"
|
android:id="@+id/nav_terminal"
|
||||||
android:icon="@drawable/ic_menu_gallery"
|
android:icon="@drawable/code_black_24dp"
|
||||||
android:title="@string/menu_gallery" />
|
android:title="@string/menu_terminal" />
|
||||||
|
|
||||||
|
|
||||||
|
</group>
|
||||||
|
<group
|
||||||
|
android:id="@+id/Down"
|
||||||
|
android:checkableBehavior="single"
|
||||||
|
android:orderInCategory="2">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_slideshow"
|
android:id="@+id/app_bar_switch"
|
||||||
android:icon="@drawable/ic_menu_slideshow"
|
android:icon="@drawable/mode_edit_black_24dp"
|
||||||
android:title="@string/menu_slideshow" />
|
android:title="@string/edit"
|
||||||
|
app:actionLayout="@layout/switch_item"
|
||||||
|
app:showAsAction="always" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_add"
|
||||||
|
android:icon="@drawable/add_black_24dp"
|
||||||
|
android:title="@string/menu_add"
|
||||||
|
android:visible="false" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_remove"
|
||||||
|
android:icon="@drawable/remove_black_24dp"
|
||||||
|
android:title="@string/menu_remove"
|
||||||
|
android:visible="false" />
|
||||||
|
</group>
|
||||||
|
<group
|
||||||
|
android:id="@+id/dynamicgroup"
|
||||||
|
android:orderInCategory="3">
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
</menu>
|
</menu>
|
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_settings"
|
|
||||||
android:orderInCategory="100"
|
|
||||||
android:title="@string/action_settings"
|
|
||||||
app:showAsAction="never" />
|
|
||||||
</menu>
|
|
23
app/src/main/res/menu/menu_main.xml
Normal file
23
app/src/main/res/menu/menu_main.xml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context="com.cringe_studios.code_guard.MainActivity">
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_lock"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
android:title="@string/lock"
|
||||||
|
app:showAsAction="never"
|
||||||
|
android:onClick="lockApp" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_settings"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
android:title="@string/action_settings"
|
||||||
|
app:showAsAction="never"
|
||||||
|
android:onClick="openSettings" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_about"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
android:title="@string/action_about"
|
||||||
|
app:showAsAction="never"
|
||||||
|
android:onClick="openAbout" />
|
||||||
|
</menu>
|
@ -12,14 +12,14 @@
|
|||||||
tools:layout="@layout/fragment_home" />
|
tools:layout="@layout/fragment_home" />
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/nav_gallery"
|
android:id="@+id/nav_about"
|
||||||
android:name="com.example.onetap_ssh.ui.gallery.GalleryFragment"
|
android:name="com.example.onetap_ssh.fragment.AboutFragment"
|
||||||
android:label="@string/menu_gallery"
|
android:label="@string/menu_gallery"
|
||||||
tools:layout="@layout/fragment_gallery" />
|
tools:layout="@layout/fragment_about" />
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/nav_slideshow"
|
android:id="@+id/nav_settings"
|
||||||
android:name="com.example.onetap_ssh.ui.slideshow.SlideshowFragment"
|
android:name="com.example.onetap_ssh.ui.slideshow.SlideshowFragment"
|
||||||
android:label="@string/menu_slideshow"
|
android:label="@string/menu_slideshow"
|
||||||
tools:layout="@layout/fragment_slideshow" />
|
tools:layout="@layout/fragment_settings" />
|
||||||
</navigation>
|
</navigation>
|
@ -193,4 +193,107 @@
|
|||||||
<string name="menu_gallery">1</string>
|
<string name="menu_gallery">1</string>
|
||||||
<string name="menu_slideshow">1</string>
|
<string name="menu_slideshow">1</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="navigation_drawer_open">OPEN NAVIGATION DRAWER</string>
|
||||||
|
<string name="navigation_drawer_close">CLOSE NAVIGATION DRAWER</string>
|
||||||
|
<string name="action_logout">LOGOUT</string>
|
||||||
|
<string name="ssh_remote">SSH-REMOTE</string>
|
||||||
|
|
||||||
|
//home
|
||||||
|
<string name="Welcome_to_your_HOMEAUTOMATION_APP">WELCOME TO TERAPLEX</string>
|
||||||
|
<string name="login_ipaddress">IP-ADDRESS</string>
|
||||||
|
<string name="login_username">USERNAME</string>
|
||||||
|
<string name="login_password">PASSWORD</string>
|
||||||
|
<string name="login">LOGIN</string>
|
||||||
|
<string name="logout">LOGOUT</string>
|
||||||
|
<string name="please_login">PLEASE CONNECT TO YOUR SSH-SERVER</string>
|
||||||
|
<string name="sie_sind_als_angemeldet">YOU ARE LOGGED IN ON {IP} AS {USERNAME}</string>
|
||||||
|
<string name="felder_dürfen_nicht_leer_sein">INPUTFIELDS CANT BE EMPTY!</string>
|
||||||
|
<string name="login_saved">LOGIN-DATA SAVED!</string>
|
||||||
|
|
||||||
|
//terminal
|
||||||
|
<string name="console">CONSOLE</string>
|
||||||
|
<string name="button_send_command">SEND COMMAND</string>
|
||||||
|
<string name="servercommands">SERVERCOMMANDS</string>
|
||||||
|
<string name="reboot">REBOOT</string>
|
||||||
|
<string name="rebooting">REBOOTING</string>
|
||||||
|
<string name="shutdown">SHUTDOWN</string>
|
||||||
|
<string name="shutting_down">SHUTTING DOWN</string>
|
||||||
|
<string name="unable_to_connect">UNABLE TO CONNECT</string>
|
||||||
|
<string name="try_again">PLEASE TRY AGAIN</string>
|
||||||
|
<string name="send">SEND</string>
|
||||||
|
<string name="connected">CONNECTED</string>
|
||||||
|
<string name="connecting">CONNECTING</string>
|
||||||
|
|
||||||
|
//main
|
||||||
|
<string name="command">COMMAND</string>
|
||||||
|
<string name="command1">COMMAND 1</string>
|
||||||
|
<string name="command2">COMMAND 2</string>
|
||||||
|
<string name="button">BUTTON</string>
|
||||||
|
<string name="button1">BUTTON 1</string>
|
||||||
|
<string name="button2">BUTTON 2</string>
|
||||||
|
|
||||||
|
//settings
|
||||||
|
<string name="farben">COLORS</string>
|
||||||
|
<string name="background">BACKGROUND</string>
|
||||||
|
<string name="button_choose_background">"CHOOSE\nBACKGROUND"</string>
|
||||||
|
<string name="reset_settings">RESET SETTINGS</string>
|
||||||
|
<string name="button_reset">RESET</string>
|
||||||
|
<string name="button_import">IMPORT</string>
|
||||||
|
<string name="button_export">EXPORT</string>
|
||||||
|
<string name="export_settings">EXPORT-SETTINGS</string>
|
||||||
|
<string name="color_scheme">COLORSCHEMES</string>
|
||||||
|
<string name="red_blue">"RED\nBLUE"</string>
|
||||||
|
<string name="green_yellow">"GREEN\nYELLOW"</string>
|
||||||
|
<string name="orange_turquoise">"ORANGE\nTURQUOISE"</string>
|
||||||
|
<string name="yellow_blue">"YELLOW\nBLUE"</string>
|
||||||
|
<string name="pink_green">"PINK\nGREEN"</string>
|
||||||
|
<string name="filename">FILENAME</string>
|
||||||
|
<string name="are_you_sure_to_reset">ARE YOU SURE YOU WANT TO RESET THE APP AND DELETE ALL YOUR SETTINGS?</string>
|
||||||
|
<string name="off">OFF</string>
|
||||||
|
<string name="on">ON</string>
|
||||||
|
<string name="logoanimation">SHOW LOGOANIMATION</string>
|
||||||
|
<string name="hapticfeedback">HAPTIC FEEDBACK</string>
|
||||||
|
|
||||||
|
//credits
|
||||||
|
<string name="version">TERAPLEX v1.1.1</string>
|
||||||
|
<string name="licence">LICENCE</string>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="team">TEAM</string>
|
||||||
|
<string name="cooperation">IN COOPERATION WITH</string>
|
||||||
|
<string name="menu_terminal">TERMINAL</string>
|
||||||
|
<string name="menu_tabs">TABS</string>
|
||||||
|
<string name="menu_add">ADD TAB</string>
|
||||||
|
<string name="menu_remove">REMOVE TABS</string>
|
||||||
|
|
||||||
|
//menus
|
||||||
|
<string name="you_will_be_redirected">YOU WILL BE REDIRECTED TO THE APP-DOCUMENTATION ON OUR WEBSITE</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_language">LANGUAGE</string>
|
||||||
|
<string name="menu_close">CLOSE</string>
|
||||||
|
|
||||||
|
<string name="invalid">INVALID INPUT</string>
|
||||||
|
<string name="tabname">TABNAME</string>
|
||||||
|
<string name="remove">REMOVE</string>
|
||||||
|
<string name="tabname_already_exist">THE TABNAME ALREADY EXISTS!</string>
|
||||||
|
<string name="choose_backgroundtype">CHOOSE BACKGROUND</string>
|
||||||
|
<string name="single_button">SINGLE BUTTON</string>
|
||||||
|
<string name="double_button">DOUBLE BUTTON</string>
|
||||||
|
<string name="heading">HEADING</string>
|
||||||
|
<string name="space">SPACE</string>
|
||||||
|
<string name="inputfields_cant_be_empty">INPUTFIELDS CANT BE EMPTY</string>
|
||||||
|
<string name="are_you_sure">ARE YOU SURE?</string>
|
||||||
|
<string name="restart_server">RESTART SERVER</string>
|
||||||
|
<string name="shutdown_server">SHUTDOWN SERVER</string>
|
||||||
|
<string name="choose_element">CHOOSE ELEMENT</string>
|
||||||
|
<string name="reset_background">RESET BACKGROUND</string>
|
||||||
|
<string name="image">IMAGE BACKGROUND</string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue
Block a user