Parcourir la source

try add emaiShower but not finished

Simon Hammer il y a 3 ans
Parent
commit
41918c373a

+ 15 - 1
app/src/main/java/com/noahvogt/miniprojekt/MainActivity.java

@@ -35,6 +35,7 @@ import androidx.navigation.ui.AppBarConfiguration;
 import androidx.navigation.ui.NavigationUI;
 
 import com.google.android.material.snackbar.Snackbar;
+import com.noahvogt.miniprojekt.ui.show.MessageShowFragment;
 import com.noahvogt.miniprojekt.ui.slideshow.EmailViewModel;
 
 import java.text.SimpleDateFormat;
@@ -51,6 +52,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
     public static EmailViewModel mEmailViewModel;
     public static RecyclerView recyclerView;
 
+    public static DrawerLayout drawer;
+
     public static final CustomAdapter adapter = new CustomAdapter(new CustomAdapter.EmailDiff());
 
     private AlertDialog dialog;
@@ -104,7 +107,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
         Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
 
-        DrawerLayout drawer = findViewById(drawer_layout);
+        drawer = findViewById(drawer_layout);
         NavigationView navigationView = findViewById(R.id.nav_view);
         // Passing each menu ID as a set of Ids because each
         // menu should be considered as top level destinations.
@@ -144,6 +147,16 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
 
             }
         });
+
+       /* if (findViewById(drawer_layout) != null){
+            if (savedInstanceState != null){
+                return;
+            }
+            getSupportFragmentManager().beginTransaction()
+                    .replace(R.id.show_Layout, new MessageShowFragment()).commit();
+        }
+
+        */
     }
 
 
@@ -203,6 +216,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
     public void onClick(View view) {}
 
 
+
     public void createNewEmailDialog(){
         // define View window
         AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);

+ 4 - 4
app/src/main/java/com/noahvogt/miniprojekt/messageCreateFragment.java

@@ -215,16 +215,16 @@ public class messageCreateFragment extends DialogFragment implements PopupMenu.O
     @Override
     public boolean onMenuItemClick(MenuItem item) {
         switch (item.getItemId()) {
-            case R.id.create_message_item_1:
+            case R.id.create_message_delete:
                 Toast.makeText(getActivity(), "item 1 clicked", Toast.LENGTH_LONG).show();
                 return true;
-            case R.id.create_message_item_2:
+            case R.id.create_message_spam:
                 Toast.makeText(getActivity(), "item 2 clicked", Toast.LENGTH_LONG).show();
                 return true;
-            case R.id.create_message_item_3:
+            case R.id.create_message_move_to:
                 Toast.makeText(getActivity(), "item 3 clicked", Toast.LENGTH_LONG).show();
                 return true;
-            case R.id.create_message_item_4:
+            case R.id.create_message_sent_to:
                 Toast.makeText(getActivity(), "item 4 clicked", Toast.LENGTH_LONG).show();
                 return true;
             default: // this case should never occur

+ 22 - 4
app/src/main/java/com/noahvogt/miniprojekt/ui/DataBase/EmailRepository.java

@@ -1,6 +1,7 @@
 package com.noahvogt.miniprojekt.ui.DataBase;
 
 import android.app.Application;
+import android.os.AsyncTask;
 
 import androidx.lifecycle.LiveData;
 
@@ -52,10 +53,6 @@ public class EmailRepository {
         return mArchiveMessage;
     }
 
-    public void deleteNewMessage(){
-        messageDao.deleteNewMessage();
-    }
-
     // You must call this on a non-UI thread or your app will throw an exception. Room ensures
     // that you're not doing any long running operations on the main thread, blocking the UI.
     public void insert(Message message) {
@@ -63,4 +60,25 @@ public class EmailRepository {
             messageDao.insert(message);
         });
     }
+
+    public void deleteMessage(final Message message){
+       /* new AsyncTask<Void, Void, Void>() {
+            @Override
+            protected Void doInBackground(Void... voids) {
+                db.MessageDao().deleteMessage(message);
+                return null;
+            }
+        }.execute();
+
+        */
+        EmailRoomDatabase.databaseWriteExecutor.execute(() -> {
+            messageDao.delete(message);
+        });
+    }
+
+    public void updateMessage(final Message message){
+        EmailRoomDatabase.databaseWriteExecutor.execute(() -> {
+            messageDao.updateMessage(message);
+        });
+    }
 }

+ 7 - 2
app/src/main/java/com/noahvogt/miniprojekt/ui/DataBase/MessageDao.java

@@ -6,6 +6,7 @@ import androidx.room.Delete;
 import androidx.room.Insert;
 import androidx.room.OnConflictStrategy;
 import androidx.room.Query;
+import androidx.room.Update;
 
 import java.util.List;
 
@@ -35,11 +36,15 @@ public interface MessageDao {
     @Query("DELETE FROM message_table")
     void deleteAll();
 
+    @Delete(entity = Message.class)
+    void delete(Message message);
+
+    @Update(entity = Message.class)
+    void updateMessage(Message message);
+
     @Query("DELETE FROM message_table WHERE subject='DELETE'")
     void deleteNewMessage();
 
-    @Delete(entity = Message.class)
-    void delete(Message message);
 
     @Query("SELECT * FROM message_table")
     LiveData<List<Message>> getAllMessages();

+ 25 - 15
app/src/main/java/com/noahvogt/miniprojekt/ui/gallery/GalleryFragment.java

@@ -19,9 +19,10 @@ import androidx.recyclerview.widget.RecyclerView;
 import com.noahvogt.miniprojekt.MainActivity;
 import com.noahvogt.miniprojekt.R;
 import com.noahvogt.miniprojekt.ui.home.CustomAdapter;
+import com.noahvogt.miniprojekt.ui.slideshow.EmailViewHolder;
 import com.noahvogt.miniprojekt.ui.slideshow.EmailViewModel;
 
-public class GalleryFragment extends Fragment {
+public class GalleryFragment extends Fragment{
 
     private GalleryViewModel galleryViewModel;
     EmailViewModel mEmailViewModel;
@@ -30,20 +31,7 @@ public class GalleryFragment extends Fragment {
     public View onCreateView(@NonNull LayoutInflater inflater,
                              ViewGroup container, Bundle savedInstanceState) {
 
-        recyclerView = MainActivity.recyclerView.findViewById(R.id.recyclerView);
-
-        final CustomAdapter adapter = new CustomAdapter(new CustomAdapter.EmailDiff());
-
-        /* Attach the adapter to the recyclerview to populate items */
-        recyclerView.setAdapter(adapter);
-        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
-        //mEmailViewModel = new ViewModelProvider(this).get(EmailViewModel.class);
 
-        mEmailViewModel = new ViewModelProvider(this).get(EmailViewModel.class);
-        mEmailViewModel.getSentMessage().observe(getViewLifecycleOwner(), messages -> {
-            /* Update the cached copy of the messages in the adapter*/
-            adapter.submitList(messages);
-        });
 
        // mEmailViewModel.deleteNewMessage();
 
@@ -57,10 +45,32 @@ public class GalleryFragment extends Fragment {
                 textView.setText(s);
             }
         });
-        return root;
 
+        recyclerView = MainActivity.recyclerView.findViewById(R.id.recyclerView);
+
+        final CustomAdapter adapter = new CustomAdapter(new CustomAdapter.EmailDiff());
+
+        /* Attach the adapter to the recyclerview to populate items */
+        recyclerView.setAdapter(adapter);
+        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
+
+
+       /* recyclerView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Toast.makeText(getContext(),"clicked Recyclerviewer", Toast.LENGTH_LONG).show();
+            }
+        });
+
+        */
 
+        mEmailViewModel = new ViewModelProvider(this).get(EmailViewModel.class);
+        mEmailViewModel.getSentMessage().observe(getViewLifecycleOwner(), messages -> {
+            /* Update the cached copy of the messages in the adapter*/
+            adapter.submitList(messages);
+        });
 
+        return root;
 
     }
 

+ 0 - 73
app/src/main/java/com/noahvogt/miniprojekt/ui/home/CustomAdapter.java

@@ -50,78 +50,5 @@ public class CustomAdapter extends ListAdapter<Message, EmailViewHolder> {
         }
     }
 
-    /**
-     * Initialize the dataset of the Adapter.
-     *
-     * @param dataSet String[] containing the data to populate views to be used
-     * by RecyclerView.
-     */
-
-
-    // Create new views (invoked by the layout manager)
-
-
-    // Replace the contents of a view (invoked by the layout manager)
-
-
-    // Return the size of your dataset (invoked by the layout manager)
-
-
-    /*
-
-    //to set the content of the Inboxfolder
-    public static void setInbox(int numItems){
-
-        for (int i =1 ; i <= numItems; i++){
-
-            message.setFrom("Hello");
-            message.setDate("Tomorrow");
-            message.setBetreff("Bye");
-        }
-
-
-    }
-
-
-    //to set the content of the Draftfolder
-    public static void setDraft(int numItems){
-
-        for (int i = 1; i <= numItems; i++){
-            message.setFrom("You");
-            message.setDate("noDay");
-            message.setBetreff("i want to die");
-        }
-
-
-    }
-
-    public static ArrayList<Message> createEmailList(int numItems){
-        ArrayList<Message> current = new ArrayList<Message>();
-
-
-            //for (int i = 1; i <= numItems; i++) {
-             //   current.add(CustomAdapter.message);
-           // }
-
-
-
-
-            for (int i = 1; i <= numItems; i++) {
-                CustomAdapter.current.add(CustomAdapter.message);
-            }
-
-
-
-
-            for (int i = 1; i <= numItems; i++) {
-                CustomAdapter.current.add(CustomAdapter.message);
-            }
-
-
-        return CustomAdapter.current;
-
-    }
-
-     */
 }
 

+ 142 - 0
app/src/main/java/com/noahvogt/miniprojekt/ui/show/MessageShowFragment.java

@@ -0,0 +1,142 @@
+package com.noahvogt.miniprojekt.ui.show;
+
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.PopupMenu;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProvider;
+
+import com.noahvogt.miniprojekt.R;
+
+
+public class MessageShowFragment extends Fragment implements PopupMenu.OnMenuItemClickListener {
+
+
+    public TextView sendingAddressObject;
+    public TextView receivingAddressObject;
+    public TextView subjectObject;
+    public TextView messageBodyObject;
+
+    private MessageShowViewModel messageShowViewModel;
+
+
+
+
+    // set theming style
+    /*@Override
+    public void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setStyle(DialogFragment.STYLE_NORMAL, R.style.messageCreateTheme);
+    }
+
+     */
+
+
+    @Nullable
+    @Override
+    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+        // set and inflate layout
+        View view = inflater.inflate(R.layout.message_show_fragment, container, false);
+
+        // init vars
+
+        messageShowViewModel =
+                new ViewModelProvider(this).get(MessageShowViewModel.class);
+        View root = inflater.inflate(R.layout.message_show_fragment, container, false);
+        final TextView textView = root.findViewById(R.id.show_message_receiving_address_layout);
+        messageShowViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
+            @Override
+            public void onChanged(@Nullable String s) {
+                textView.setText(s);
+            }
+        });
+
+
+        ImageButton closeButton = view.findViewById(R.id.show_message_close_button);
+        ImageButton dotButton = view.findViewById(R.id.show_message_dots_button);
+        ImageButton attachButton = view.findViewById(R.id.show_message_attach_button);
+
+        sendingAddressObject = (EditText) view.findViewById(R.id.create_message_sending_address_text);
+        receivingAddressObject = (EditText) view.findViewById(R.id.create_message_receiving_address_text);
+        subjectObject = (EditText) view.findViewById(R.id.create_message_subject_text);
+        messageBodyObject = (EditText) view.findViewById(R.id.create_message_body_text);
+
+        // get string vars, MAYBE NOT HERE
+        String sendingAddress = sendingAddressObject.getText().toString();
+        String receivingAddress = receivingAddressObject.getText().toString();
+        //String subject = subjectObject.getText().toString();
+        String messageBody = messageBodyObject.getText().toString();
+
+
+        /* dosen't wotk cause Activity is not extendet and used as variable */
+
+
+
+
+
+
+        // TODO: add cc + bcc functionality
+
+        // button listeners
+
+        closeButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+            }
+
+        });
+
+        attachButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                // TODO: add file attachment functionality
+            }
+        });
+
+        dotButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                PopupMenu popupMenu = new PopupMenu(getActivity(), v);
+                popupMenu.setOnMenuItemClickListener(MessageShowFragment.this::onMenuItemClick);
+                popupMenu.inflate(R.menu.create_message_options_menu);
+                popupMenu.show();
+            }
+        });
+
+        return root;
+    }
+
+
+    @Override
+    public boolean onMenuItemClick(MenuItem item) {
+        switch (item.getItemId()) {
+            case R.id.create_message_delete:
+                Toast.makeText(getActivity(), "item delete clicked", Toast.LENGTH_LONG).show();
+                return true;
+            case R.id.create_message_spam:
+                Toast.makeText(getActivity(), "item spam clicked", Toast.LENGTH_LONG).show();
+                return true;
+            case R.id.create_message_sent_to:
+                Toast.makeText(getActivity(), "item sent to clicked", Toast.LENGTH_LONG).show();
+                return true;
+            case R.id.create_message_move_to:
+                Toast.makeText(getActivity(), "item move to clicked", Toast.LENGTH_LONG).show();
+                return true;
+            default: // this case should never occur
+                return false;
+        }
+    }
+}

+ 19 - 0
app/src/main/java/com/noahvogt/miniprojekt/ui/show/MessageShowViewModel.java

@@ -0,0 +1,19 @@
+package com.noahvogt.miniprojekt.ui.show;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+public class MessageShowViewModel extends ViewModel {
+
+    private MutableLiveData<String> mText;
+
+    public MessageShowViewModel() {
+        mText = new MutableLiveData<>();
+        mText.setValue("This is from Simon");
+    }
+
+    public LiveData<String> getText() {
+        return mText;
+    }
+}

+ 83 - 5
app/src/main/java/com/noahvogt/miniprojekt/ui/slideshow/EmailViewHolder.java

@@ -1,13 +1,23 @@
 package com.noahvogt.miniprojekt.ui.slideshow;
 
-import android.provider.Telephony;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.EditText;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.noahvogt.miniprojekt.MainActivity;
+import com.noahvogt.miniprojekt.ui.show.MessageShowFragment;
 import com.noahvogt.miniprojekt.R;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.drawerlayout.widget.DrawerLayout;
+import androidx.fragment.app.DialogFragment;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.navigation.Navigation;
+import androidx.navigation.ui.AppBarConfiguration;
 import androidx.recyclerview.widget.RecyclerView;
 
 /* adds the content to the View of RecyclerView*/
@@ -15,14 +25,34 @@ public class EmailViewHolder extends RecyclerView.ViewHolder {
     private final TextView fromItemView;
     private final TextView subjectItemView;
     private final TextView dateItemView;
-    private final TextView messageItemView;
+    public final TextView messageItemView;
+
+    private AppBarConfiguration mAppBarConfiguration;
+
 
-    private EmailViewHolder(View itemView) {
+    private EmailViewHolder(View itemView, ViewGroup parent) {
         super(itemView);
         fromItemView = itemView.findViewById(R.id.textView);
         subjectItemView = itemView.findViewById(R.id.subject);
         dateItemView = itemView.findViewById(R.id.date);
         messageItemView = itemView.findViewById(R.id.message);
+        itemView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Toast.makeText(v.getContext(), "clicked ViewHolder ", Toast.LENGTH_LONG).show();
+              /*  Fragment fragment = new MessageShowFragment();
+                if (!fragment.isAdded()){
+                    Toast.makeText(v.getContext(), "is not Added ", Toast.LENGTH_LONG).show();
+
+                    FragmentManager fragmentManager = fragment.getParentFragmentManager();
+                    fragmentManager.beginTransaction()
+                        .add(R.id.nav_show, MessageShowFragment.class, null)
+                        .commit();
+                }
+
+               */
+            }
+        });
     }
 
     public void bind(String from, String subject, String date, String message) {
@@ -35,8 +65,56 @@ public class EmailViewHolder extends RecyclerView.ViewHolder {
     public static EmailViewHolder create(ViewGroup parent) {
         View view = LayoutInflater.from(parent.getContext())
                 .inflate(R.layout.fragment_home, parent, false);
-        return new EmailViewHolder(view);
+        return new EmailViewHolder(view, parent);
+    }
+
+
+
+   /* public void createNewEmailDialog(){
+        // define View window
+        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(itemView.getContext());
+
+        // init text field variables
+        newemail_name = emailPopupView.findViewById(R.id.popup_material_name_asking_text);
+        newemail_email = emailPopupView.findViewById(R.id.popup_material_email_asking_text);
+        newemail_password = emailPopupView.findViewById(R.id.popup_material_password_asking_text);
+
+        // init button variables
+        Button newemail_save_button = (Button) emailPopupView.findViewById(R.id.saveButton);
+        // may not be private
+        Button newemail_cancel_button = (Button) emailPopupView.findViewById(R.id.cancelButton);
+
+        // open View window
+        dialogBuilder.setView(emailPopupView);
+        dialog = dialogBuilder.create();
+        dialog.show();
+
+        // store user input
+        newemail_save_button.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                // store user input (only needed for DEBUGGING)
+                String name = newemail_name.getText().toString();
+                String email = newemail_email.getText().toString();
+                String password = newemail_password.getText().toString();
+
+                if (!mailFunctions.validateEmail(newemail_email) | !mailFunctions.validateName(newemail_name) | !mailFunctions.validatePassword(newemail_password)) {
+                    return;
+                }
+
+                // show all strings the user gave, this will later be stored to a secure database and checked for validation
+                showToast(name);
+                showToast(email);
+                showToast(password);
+
+
+                showSnackbar(emailPopupView,"save button clicked");
+            }
+        });
+
+    */
+
     }
-}
 
 

+ 3 - 4
app/src/main/java/com/noahvogt/miniprojekt/ui/slideshow/EmailViewModel.java

@@ -42,10 +42,9 @@ public class EmailViewModel extends AndroidViewModel {
 
     public LiveData<List<Message>> getArchiveMessage(){ return mArchiveMessage;}
 
-    public void deleteNewMessage(){
-        mEmailRepository.deleteNewMessage();
-    }
-
     public void insert(Message message){mEmailRepository.insert(message);}
 
+    public void deleteMessage(Message message){mEmailRepository.deleteMessage(message);}
+
+    public void updateMessage(Message message){mEmailRepository.updateMessage(message);}
 }

+ 1 - 12
app/src/main/res/layout/activity_main.xml

@@ -9,24 +9,13 @@
     tools:openDrawer="start"
     tools:context=".MainActivity">
 
-
-    <androidx.recyclerview.widget.RecyclerView
-        android:id="@+id/recyclerView"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:paddingTop="50dp"
-        app:layoutManager="androidx.recyclerview.widget.GridLayoutManager">
-
-    </androidx.recyclerview.widget.RecyclerView>
-
-
-
     <include
         layout="@layout/app_bar_main"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:paddingLeft="20dp"
         android:paddingRight="20dp" />
+
     <com.google.android.material.navigation.NavigationView
         android:id="@+id/nav_view"
         android:layout_width="wrap_content"

+ 9 - 0
app/src/main/res/layout/content_main.xml

@@ -18,6 +18,15 @@
         app:layout_constraintTop_toTopOf="parent"
         app:navGraph="@navigation/mobile_navigation" />
 
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/recyclerView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:paddingTop="50dp"
+        app:layoutManager="androidx.recyclerview.widget.GridLayoutManager">
+
+    </androidx.recyclerview.widget.RecyclerView>
+
         <com.google.android.material.floatingactionbutton.FloatingActionButton
             android:id="@+id/messageButton"
             app:layout_constraintBottom_toBottomOf="parent"

+ 2 - 0
app/src/main/res/layout/fragment_home.xml

@@ -49,4 +49,6 @@
         android:gravity="left" />
 
 
+
+
 </GridLayout>

+ 199 - 0
app/src/main/res/layout/message_show_fragment.xml

@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout 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"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:id="@+id/messageFragment"
+    android:orientation="vertical"
+    tools:context=".ui.show.MessageShowFragment">
+
+
+    <androidx.cardview.widget.CardView
+        android:id="@+id/cardShowView"
+        android:layout_width="match_parent"
+        android:layout_height="?attr/actionBarSize"
+        app:cardBackgroundColor="#5e35b1"
+        tools:ignore="MissingConstraints">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <ImageButton
+                android:id="@+id/show_message_close_button"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerVertical="true"
+                android:layout_marginLeft="0dp"
+                android:layout_marginStart="0dp"
+                android:background="?attr/selectableItemBackgroundBorderless"
+                android:padding="8dp"
+                android:src="@mipmap/ic_close_purple" />
+
+            <ImageButton
+                android:id="@+id/show_message_dots_button"
+                android:layout_width="56dp"
+                android:layout_height="match_parent"
+
+                android:layout_marginLeft="360dp"
+                android:layout_marginStart="360dp"
+                android:background="?attr/selectableItemBackgroundBorderless"
+                android:padding="8dp"
+                android:src="@mipmap/ic_more_vert_dots_purple" />
+
+            <ImageButton
+                android:id="@+id/show_message_attach_button"
+                android:layout_width="56dp"
+                android:layout_height="match_parent"
+
+
+                android:layout_toEndOf="@id/show_message_dots_button"
+                android:layout_marginLeft="-110dp"
+                android:background="?attr/selectableItemBackgroundBorderless"
+                android:padding="8dp"
+                android:src="@mipmap/ic_attach_purple"
+                android:layout_toRightOf="@id/show_message_dots_button"
+                android:layout_marginStart="-110dp" />
+
+
+
+
+        </RelativeLayout>
+    </androidx.cardview.widget.CardView>
+
+
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:gravity="top">
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:id="@+id/show_message_sending_address_layout"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+
+                android:layout_marginStart="12dp"
+                android:layout_marginLeft="12dp"
+                android:layout_marginTop="12dp"
+                android:layout_marginEnd="12dp"
+                android:layout_marginRight="12dp"
+                android:layout_marginBottom="12dp">
+
+            <TextView
+                android:id="@+id/show_From"
+                android:text="@string/show_from"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+
+                android:layout_marginStart="12dp"
+                android:layout_marginLeft="12dp"
+                android:layout_marginTop="12dp"
+                android:layout_marginEnd="12dp"
+                android:layout_marginRight="12dp"
+                android:layout_marginBottom="12dp" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:id="@+id/show_message_receiving_address_layout"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+
+                android:layout_marginStart="12dp"
+                android:layout_marginLeft="12dp"
+                android:layout_marginTop="12dp"
+                android:layout_marginEnd="12dp"
+                android:layout_marginRight="12dp"
+                android:layout_marginBottom="12dp">
+
+                <TextView
+                    android:id="@+id/show_To"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="12dp"
+
+                    android:layout_marginLeft="12dp"
+                    android:layout_marginTop="12dp"
+                    android:layout_marginEnd="12dp"
+                    android:layout_marginRight="12dp"
+                    android:layout_marginBottom="12dp"
+                    android:hint="@string/show_To" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:id="@+id/show_message_subject_layout"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+
+                android:layout_marginStart="12dp"
+                android:layout_marginLeft="12dp"
+                android:layout_marginTop="12dp"
+                android:layout_marginEnd="12dp"
+                android:layout_marginRight="12dp"
+                android:layout_marginBottom="12dp"
+
+                app:layout_constraintTop_toBottomOf="@+id/show_message_sending_address_layout"
+                tools:layout_editor_absoluteX="1dp">
+
+            <TextView
+                    android:id="@+id/show_message_subject_text"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:hint="@string/show_subject"
+                    android:inputType="textEmailSubject"
+
+                    android:layout_marginStart="12dp"
+                    android:layout_marginLeft="12dp"
+                    android:layout_marginTop="12dp"
+                    android:layout_marginEnd="12dp"
+                    android:layout_marginRight="12dp"
+                    android:layout_marginBottom="12dp"/>
+            </com.google.android.material.textfield.TextInputLayout>
+
+            <com.google.android.material.textfield.TextInputLayout
+                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+                android:id="@+id/show_message_body_layout"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+
+                android:layout_marginStart="12dp"
+                android:layout_marginLeft="12dp"
+                android:layout_marginTop="12dp"
+                android:layout_marginEnd="12dp"
+                android:layout_marginRight="12dp"
+                android:layout_marginBottom="12dp"
+
+                app:layout_constraintTop_toBottomOf="@+id/show_message_sending_address_layout"
+                tools:layout_editor_absoluteX="1dp">
+
+                <TextView
+                    android:id="@+id/show_message_body_text"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:minHeight="160dp"
+                    android:textAlignment="viewStart"
+                    android:hint="Message ..."
+                    android:inputType="textMultiLine"
+                    android:gravity="start" />
+            </com.google.android.material.textfield.TextInputLayout>
+
+        </LinearLayout>
+
+    </ScrollView>
+
+    <FrameLayout
+        android:id="@+id/show_Layout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 8 - 8
app/src/main/res/menu/create_message_options_menu.xml

@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <item android:id="@+id/create_message_item_1"
-        android:title="Item 1"/>
-    <item android:id="@+id/create_message_item_2"
-        android:title="Item 2"/>
-    <item android:id="@+id/create_message_item_3"
-        android:title="Item 3"/>
-    <item android:id="@+id/create_message_item_4"
-        android:title="Item 4"/>
+    <item android:id="@+id/create_message_delete"
+        android:title="@string/menu_delete"/>
+    <item android:id="@+id/create_message_spam"
+        android:title="@string/menu_spam"/>
+    <item android:id="@+id/create_message_sent_to"
+        android:title="@string/menu_sent_to"/>
+    <item android:id="@+id/create_message_move_to"
+        android:title="@string/menu_move_to"/>
 
 </menu>

+ 3 - 0
app/src/main/res/navigation/mobile_navigation.xml

@@ -35,4 +35,7 @@
         android:label="@string/drawer_spam"
         tools:layout="@layout/fragment_spam" />
 
+    <fragment
+        android:id="@+id/nav_show"
+        android:name="com.noahvogt.miniprojekt.ui.show.MessageShowFragment"/>
 </navigation>

+ 10 - 0
app/src/main/res/values/strings.xml

@@ -16,6 +16,16 @@
     <string name="your_email_address_filler">Your Email Address</string>
     <string name="your_full_name_filler">Your Full Name</string>
 
+    <string name="show_from">From</string>
+    <string name="show_To">To </string>
+    <string name="show_subject">Subject</string>
+    <string name="show_message">Message</string>
+
+    <string name="menu_delete">Delete</string>
+    <string name="menu_move_to">Move to</string>
+    <string name="menu_spam">Spam</string>
+    <string name="menu_sent_to">Sent to</string>
+
     <string name="Sender">Absender</string>
     <string name="Betreff">Betreff</string>
     <string name="Beginn">E-mail Beginn</string>