Grungerüst steht bis auf die Entfernung des Menüpunktes slideshow

This commit is contained in:
m_broelemann 2020-12-14 09:41:19 +01:00
parent 3d79b297c5
commit f96430fb16
11 changed files with 50 additions and 50 deletions

View File

@ -36,7 +36,7 @@ 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_all_IOs, R.id.nav_your_IOs, R.id.nav_slideshow)
.setDrawerLayout(drawer) .setDrawerLayout(drawer)
.build(); .build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment); NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
@ -63,16 +63,16 @@ public class MainActivity extends AppCompatActivity {
public boolean onOptionsItemSelected(@NonNull MenuItem item) { public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()){ switch (item.getItemId()){
case R.id.action_settings: case R.id.action_settings:
Toast.makeText(this,"settings",Toast.LENGTH_SHORT).show(); Toast.makeText(this,"Settings",Toast.LENGTH_SHORT).show();
return true; return true;
case R.id.action_adjust_xml: case R.id.action_adjust_xml:
Toast.makeText(this,"adjust",Toast.LENGTH_SHORT).show(); Toast.makeText(this,"Adjust .xml",Toast.LENGTH_SHORT).show();
return true; return true;
case R.id.action_download_xml: case R.id.action_download_xml:
Toast.makeText(this,"download",Toast.LENGTH_SHORT).show(); Toast.makeText(this,"Download .xml",Toast.LENGTH_SHORT).show();
return true; return true;
case R.id.action_upload_xml: case R.id.action_upload_xml:
Toast.makeText(this,"upload",Toast.LENGTH_SHORT).show(); Toast.makeText(this,"Upload .xml",Toast.LENGTH_SHORT).show();
return true; return true;
default: default:
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);

View File

@ -1,4 +1,4 @@
package com.example.aped.ui.gallery; package com.example.aped.ui.all_IOs;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -14,17 +14,17 @@ import androidx.lifecycle.ViewModelProvider;
import com.example.aped.R; import com.example.aped.R;
public class GalleryFragment extends Fragment { public class All_IOs_Fragment extends Fragment {
private GalleryViewModel galleryViewModel; private All_IOs_ViewModel allIOsViewModel;
public View onCreateView(@NonNull LayoutInflater inflater, public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
galleryViewModel = allIOsViewModel =
new ViewModelProvider(this).get(GalleryViewModel.class); new ViewModelProvider(this).get(All_IOs_ViewModel.class);
View root = inflater.inflate(R.layout.fragment_gallery, container, false); View root = inflater.inflate(R.layout.fragment_all_ios, container, false);
final TextView textView = root.findViewById(R.id.text_gallery); final TextView textView = root.findViewById(R.id.text_all_IOs);
galleryViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() { allIOsViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override @Override
public void onChanged(@Nullable String s) { public void onChanged(@Nullable String s) {
textView.setText(s); textView.setText(s);

View File

@ -1,14 +1,14 @@
package com.example.aped.ui.home; package com.example.aped.ui.all_IOs;
import androidx.lifecycle.LiveData; import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModel;
public class HomeViewModel extends ViewModel { public class All_IOs_ViewModel extends ViewModel {
private MutableLiveData<String> mText; private MutableLiveData<String> mText;
public HomeViewModel() { public All_IOs_ViewModel() {
mText = new MutableLiveData<>(); mText = new MutableLiveData<>();
mText.setValue("Anzeige aller Mess & Sollwertvorgaben bestimmt durch die xml"); mText.setValue("Anzeige aller Mess & Sollwertvorgaben bestimmt durch die xml");
} }

View File

@ -1,4 +1,4 @@
package com.example.aped.ui.home; package com.example.aped.ui.your_IOs;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -14,17 +14,17 @@ import androidx.lifecycle.ViewModelProvider;
import com.example.aped.R; import com.example.aped.R;
public class HomeFragment extends Fragment { public class Your_IOs_Fragment extends Fragment {
private HomeViewModel homeViewModel; private Your_IOs_ViewModel your_IOs_ViewModel;
public View onCreateView(@NonNull LayoutInflater inflater, public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
homeViewModel = your_IOs_ViewModel =
new ViewModelProvider(this).get(HomeViewModel.class); new ViewModelProvider(this).get(Your_IOs_ViewModel.class);
View root = inflater.inflate(R.layout.fragment_home, container, false); View root = inflater.inflate(R.layout.fragment_your_ios, container, false);
final TextView textView = root.findViewById(R.id.text_home); final TextView textView = root.findViewById(R.id.text_your_IOs);
homeViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() { your_IOs_ViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
@Override @Override
public void onChanged(@Nullable String s) { public void onChanged(@Nullable String s) {
textView.setText(s); textView.setText(s);

View File

@ -1,14 +1,14 @@
package com.example.aped.ui.gallery; package com.example.aped.ui.your_IOs;
import androidx.lifecycle.LiveData; import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModel;
public class GalleryViewModel extends ViewModel { public class Your_IOs_ViewModel extends ViewModel {
private MutableLiveData<String> mText; private MutableLiveData<String> mText;
public GalleryViewModel() { public Your_IOs_ViewModel() {
mText = new MutableLiveData<>(); mText = new MutableLiveData<>();
mText.setValue("Personalisierte Anzeige der Mess- & Sollwerte"); mText.setValue("Personalisierte Anzeige der Mess- & Sollwerte");
} }

View File

@ -2,8 +2,8 @@
android:shape="rectangle"> android:shape="rectangle">
<gradient <gradient
android:angle="135" android:angle="135"
android:centerColor="#009688" android:centerColor="#7a2f2f"
android:endColor="#00695C" android:endColor="#f01313"
android:startColor="#4DB6AC" android:startColor="#2e2f30"
android:type="linear" /> android:type="linear" />
</shape> </shape>

View File

@ -4,10 +4,10 @@
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:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.gallery.GalleryFragment"> tools:context=".ui.all_IOs.All_IOs_Fragment">
<TextView <TextView
android:id="@+id/text_gallery" android:id="@+id/text_all_IOs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"

View File

@ -4,10 +4,10 @@
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:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.home.HomeFragment"> tools:context=".ui.your_IOs.Your_IOs_Fragment">
<TextView <TextView
android:id="@+id/text_home" android:id="@+id/text_your_IOs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"

View File

@ -5,13 +5,13 @@
<group android:checkableBehavior="single"> <group android:checkableBehavior="single">
<item <item
android:id="@+id/nav_home" android:id="@+id/nav_all_IOs"
android:icon="@drawable/ic_menu_camera" android:icon="@drawable/ic_menu_camera"
android:title="@string/menu_home" /> android:title="@string/menu_all_IOs" />
<item <item
android:id="@+id/nav_gallery" android:id="@+id/nav_your_IOs"
android:icon="@drawable/ic_menu_gallery" android:icon="@drawable/ic_menu_gallery"
android:title="@string/menu_gallery" /> android:title="@string/menu_all_IOs" />
<item <item
android:id="@+id/nav_slideshow" android:id="@+id/nav_slideshow"
android:icon="@drawable/ic_menu_slideshow" android:icon="@drawable/ic_menu_slideshow"

View File

@ -3,19 +3,19 @@
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:id="@+id/mobile_navigation" android:id="@+id/mobile_navigation"
app:startDestination="@+id/nav_home"> app:startDestination="@+id/nav_all_IOs">
<fragment <fragment
android:id="@+id/nav_home" android:id="@+id/nav_all_IOs"
android:name="com.example.aped.ui.home.HomeFragment" android:name="com.example.aped.ui.all_IOs.All_IOs_Fragment"
android:label="@string/menu_home" android:label="@string/menu_all_IOs"
tools:layout="@layout/fragment_home" /> tools:layout="@layout/fragment_all_ios" />
<fragment <fragment
android:id="@+id/nav_gallery" android:id="@+id/nav_your_IOs"
android:name="com.example.aped.ui.gallery.GalleryFragment" android:name="com.example.aped.ui.your_IOs.Your_IOs_Fragment"
android:label="@string/menu_gallery" android:label="@string/menu_your_IOs"
tools:layout="@layout/fragment_gallery" /> tools:layout="@layout/fragment_your_ios" />
<fragment <fragment
android:id="@+id/nav_slideshow" android:id="@+id/nav_slideshow"

View File

@ -3,14 +3,14 @@
<string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">APED</string> <string name="nav_header_title">APED</string>
<string name="nav_header_subtitle">space for information</string> <string name="nav_header_subtitle">the simple way with your project</string>
<string name="nav_header_desc">Navigation header</string> <string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
<string name="action_adjust_xml">Adjust .xml</string> <string name="action_adjust_xml">Adjust .xml</string>
<string name="action_download_xml">Download .xml</string> <string name="action_download_xml">Download .xml</string>
<string name="action_upload_xml">Upload .xml</string> <string name="action_upload_xml">Upload .xml</string>
<string name="menu_home">all IOs</string> <string name="menu_all_IOs">all IOs</string>
<string name="menu_gallery">your IOs</string> <string name="menu_your_IOs">your IOs</string>
<string name="menu_slideshow">noch zu entfernen</string> <string name="menu_slideshow">noch zu entfernen</string>
</resources> </resources>