From f96430fb1644c606f316ad4439ab0ecd29dc6a67 Mon Sep 17 00:00:00 2001 From: m_broelemann Date: Mon, 14 Dec 2020 09:41:19 +0100 Subject: [PATCH] =?UTF-8?q?Grunger=C3=BCst=20steht=20bis=20auf=20die=20Ent?= =?UTF-8?q?fernung=20des=20Men=C3=BCpunktes=20slideshow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/aped/MainActivity.java | 10 +++++----- .../All_IOs_Fragment.java} | 16 ++++++++-------- .../All_IOs_ViewModel.java} | 6 +++--- .../Your_IOs_Fragment.java} | 16 ++++++++-------- .../Your_IOs_ViewModel.java} | 6 +++--- .../app/src/main/res/drawable/side_nav_bar.xml | 6 +++--- ...agment_gallery.xml => fragment_all_ios.xml} | 4 ++-- ...fragment_home.xml => fragment_your_ios.xml} | 4 ++-- .../src/main/res/menu/activity_main_drawer.xml | 8 ++++---- .../main/res/navigation/mobile_navigation.xml | 18 +++++++++--------- APED/app/src/main/res/values/strings.xml | 6 +++--- 11 files changed, 50 insertions(+), 50 deletions(-) rename APED/app/src/main/java/com/example/aped/ui/{gallery/GalleryFragment.java => all_IOs/All_IOs_Fragment.java} (60%) rename APED/app/src/main/java/com/example/aped/ui/{home/HomeViewModel.java => all_IOs/All_IOs_ViewModel.java} (75%) rename APED/app/src/main/java/com/example/aped/ui/{home/HomeFragment.java => your_IOs/Your_IOs_Fragment.java} (58%) rename APED/app/src/main/java/com/example/aped/ui/{gallery/GalleryViewModel.java => your_IOs/Your_IOs_ViewModel.java} (74%) rename APED/app/src/main/res/layout/{fragment_gallery.xml => fragment_all_ios.xml} (90%) rename APED/app/src/main/res/layout/{fragment_home.xml => fragment_your_ios.xml} (90%) diff --git a/APED/app/src/main/java/com/example/aped/MainActivity.java b/APED/app/src/main/java/com/example/aped/MainActivity.java index 012c67e..33a481f 100644 --- a/APED/app/src/main/java/com/example/aped/MainActivity.java +++ b/APED/app/src/main/java/com/example/aped/MainActivity.java @@ -36,7 +36,7 @@ public class MainActivity extends AppCompatActivity { // Passing each menu ID as a set of Ids because each // menu should be considered as top level destinations. 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) .build(); 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) { switch (item.getItemId()){ case R.id.action_settings: - Toast.makeText(this,"settings",Toast.LENGTH_SHORT).show(); + Toast.makeText(this,"Settings",Toast.LENGTH_SHORT).show(); return true; 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; 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; 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; default: return super.onOptionsItemSelected(item); diff --git a/APED/app/src/main/java/com/example/aped/ui/gallery/GalleryFragment.java b/APED/app/src/main/java/com/example/aped/ui/all_IOs/All_IOs_Fragment.java similarity index 60% rename from APED/app/src/main/java/com/example/aped/ui/gallery/GalleryFragment.java rename to APED/app/src/main/java/com/example/aped/ui/all_IOs/All_IOs_Fragment.java index db4ef42..c150c30 100644 --- a/APED/app/src/main/java/com/example/aped/ui/gallery/GalleryFragment.java +++ b/APED/app/src/main/java/com/example/aped/ui/all_IOs/All_IOs_Fragment.java @@ -1,4 +1,4 @@ -package com.example.aped.ui.gallery; +package com.example.aped.ui.all_IOs; import android.os.Bundle; import android.view.LayoutInflater; @@ -14,17 +14,17 @@ import androidx.lifecycle.ViewModelProvider; 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, ViewGroup container, Bundle savedInstanceState) { - galleryViewModel = - new ViewModelProvider(this).get(GalleryViewModel.class); - View root = inflater.inflate(R.layout.fragment_gallery, container, false); - final TextView textView = root.findViewById(R.id.text_gallery); - galleryViewModel.getText().observe(getViewLifecycleOwner(), new Observer() { + allIOsViewModel = + new ViewModelProvider(this).get(All_IOs_ViewModel.class); + View root = inflater.inflate(R.layout.fragment_all_ios, container, false); + final TextView textView = root.findViewById(R.id.text_all_IOs); + allIOsViewModel.getText().observe(getViewLifecycleOwner(), new Observer() { @Override public void onChanged(@Nullable String s) { textView.setText(s); diff --git a/APED/app/src/main/java/com/example/aped/ui/home/HomeViewModel.java b/APED/app/src/main/java/com/example/aped/ui/all_IOs/All_IOs_ViewModel.java similarity index 75% rename from APED/app/src/main/java/com/example/aped/ui/home/HomeViewModel.java rename to APED/app/src/main/java/com/example/aped/ui/all_IOs/All_IOs_ViewModel.java index 662ab51..4c3bcb8 100644 --- a/APED/app/src/main/java/com/example/aped/ui/home/HomeViewModel.java +++ b/APED/app/src/main/java/com/example/aped/ui/all_IOs/All_IOs_ViewModel.java @@ -1,14 +1,14 @@ -package com.example.aped.ui.home; +package com.example.aped.ui.all_IOs; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; -public class HomeViewModel extends ViewModel { +public class All_IOs_ViewModel extends ViewModel { private MutableLiveData mText; - public HomeViewModel() { + public All_IOs_ViewModel() { mText = new MutableLiveData<>(); mText.setValue("Anzeige aller Mess & Sollwertvorgaben bestimmt durch die xml"); } diff --git a/APED/app/src/main/java/com/example/aped/ui/home/HomeFragment.java b/APED/app/src/main/java/com/example/aped/ui/your_IOs/Your_IOs_Fragment.java similarity index 58% rename from APED/app/src/main/java/com/example/aped/ui/home/HomeFragment.java rename to APED/app/src/main/java/com/example/aped/ui/your_IOs/Your_IOs_Fragment.java index 623c9fc..d77110f 100644 --- a/APED/app/src/main/java/com/example/aped/ui/home/HomeFragment.java +++ b/APED/app/src/main/java/com/example/aped/ui/your_IOs/Your_IOs_Fragment.java @@ -1,4 +1,4 @@ -package com.example.aped.ui.home; +package com.example.aped.ui.your_IOs; import android.os.Bundle; import android.view.LayoutInflater; @@ -14,17 +14,17 @@ import androidx.lifecycle.ViewModelProvider; 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, ViewGroup container, Bundle savedInstanceState) { - homeViewModel = - new ViewModelProvider(this).get(HomeViewModel.class); - View root = inflater.inflate(R.layout.fragment_home, container, false); - final TextView textView = root.findViewById(R.id.text_home); - homeViewModel.getText().observe(getViewLifecycleOwner(), new Observer() { + your_IOs_ViewModel = + new ViewModelProvider(this).get(Your_IOs_ViewModel.class); + View root = inflater.inflate(R.layout.fragment_your_ios, container, false); + final TextView textView = root.findViewById(R.id.text_your_IOs); + your_IOs_ViewModel.getText().observe(getViewLifecycleOwner(), new Observer() { @Override public void onChanged(@Nullable String s) { textView.setText(s); diff --git a/APED/app/src/main/java/com/example/aped/ui/gallery/GalleryViewModel.java b/APED/app/src/main/java/com/example/aped/ui/your_IOs/Your_IOs_ViewModel.java similarity index 74% rename from APED/app/src/main/java/com/example/aped/ui/gallery/GalleryViewModel.java rename to APED/app/src/main/java/com/example/aped/ui/your_IOs/Your_IOs_ViewModel.java index 29450b7..91df341 100644 --- a/APED/app/src/main/java/com/example/aped/ui/gallery/GalleryViewModel.java +++ b/APED/app/src/main/java/com/example/aped/ui/your_IOs/Your_IOs_ViewModel.java @@ -1,14 +1,14 @@ -package com.example.aped.ui.gallery; +package com.example.aped.ui.your_IOs; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; -public class GalleryViewModel extends ViewModel { +public class Your_IOs_ViewModel extends ViewModel { private MutableLiveData mText; - public GalleryViewModel() { + public Your_IOs_ViewModel() { mText = new MutableLiveData<>(); mText.setValue("Personalisierte Anzeige der Mess- & Sollwerte"); } diff --git a/APED/app/src/main/res/drawable/side_nav_bar.xml b/APED/app/src/main/res/drawable/side_nav_bar.xml index 6d81870..df4cd98 100644 --- a/APED/app/src/main/res/drawable/side_nav_bar.xml +++ b/APED/app/src/main/res/drawable/side_nav_bar.xml @@ -2,8 +2,8 @@ android:shape="rectangle"> \ No newline at end of file diff --git a/APED/app/src/main/res/layout/fragment_gallery.xml b/APED/app/src/main/res/layout/fragment_all_ios.xml similarity index 90% rename from APED/app/src/main/res/layout/fragment_gallery.xml rename to APED/app/src/main/res/layout/fragment_all_ios.xml index 643fe25..83a99b8 100644 --- a/APED/app/src/main/res/layout/fragment_gallery.xml +++ b/APED/app/src/main/res/layout/fragment_all_ios.xml @@ -4,10 +4,10 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.gallery.GalleryFragment"> + tools:context=".ui.all_IOs.All_IOs_Fragment"> + tools:context=".ui.your_IOs.Your_IOs_Fragment"> + android:title="@string/menu_all_IOs" /> + android:title="@string/menu_all_IOs" /> + app:startDestination="@+id/nav_all_IOs"> + android:id="@+id/nav_all_IOs" + android:name="com.example.aped.ui.all_IOs.All_IOs_Fragment" + android:label="@string/menu_all_IOs" + tools:layout="@layout/fragment_all_ios" /> + android:id="@+id/nav_your_IOs" + android:name="com.example.aped.ui.your_IOs.Your_IOs_Fragment" + android:label="@string/menu_your_IOs" + tools:layout="@layout/fragment_your_ios" /> Open navigation drawer Close navigation drawer APED - space for information + the simple way with your project Navigation header Settings Adjust .xml Download .xml Upload .xml - all IOs - your IOs + all IOs + your IOs noch zu entfernen \ No newline at end of file