|
@@ -3,11 +3,16 @@ package com.noahvogt.miniprojekt;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.view.Menu;
|
|
import android.view.Menu;
|
|
|
|
+import android.webkit.WebHistoryItem;
|
|
|
|
+import android.widget.Button;
|
|
|
|
+import android.widget.EditText;
|
|
|
|
+import android.widget.TextView;
|
|
|
|
|
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|
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.AlertDialog;
|
|
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;
|
|
@@ -20,6 +25,14 @@ public class MainActivity extends AppCompatActivity {
|
|
|
|
|
|
private AppBarConfiguration mAppBarConfiguration;
|
|
private AppBarConfiguration mAppBarConfiguration;
|
|
|
|
|
|
|
|
+ private AlertDialog.Builder dialogBuilder;
|
|
|
|
+ private AlertDialog dialog;
|
|
|
|
+ private EditText newemail_name, newemail_email, newemail_password;
|
|
|
|
+ private Button newemail_save_button, newemail_cancel_button;
|
|
|
|
+
|
|
|
|
+ public MainActivity() {
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
@@ -60,4 +73,47 @@ public class MainActivity extends AppCompatActivity {
|
|
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|
|
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|
|
|| super.onSupportNavigateUp();
|
|
|| super.onSupportNavigateUp();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
+ // change inbox text (WARNING: throws error whenever drafts oder sent is active instead of inbox)
|
|
|
|
+ //TextView text = (TextView) findViewById(R.id.text_home);
|
|
|
|
+ //text.setText("Mail has been SuCceSsFuLlY aDdEd");
|
|
|
|
+
|
|
|
|
+ // display snackbar message
|
|
|
|
+ Snackbar.make(view, "Mail has been SuCceSsFuLlY aDdEd", Snackbar.LENGTH_LONG)
|
|
|
|
+ .setAction("Action", null).show();
|
|
|
|
+ createNewEmailDialog();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public void createNewEmailDialog(){
|
|
|
|
+ dialogBuilder = new AlertDialog.Builder(this);
|
|
|
|
+ final View emailPopupView = getLayoutInflater().inflate(R.layout.popup, null);
|
|
|
|
+ newemail_name = (EditText) emailPopupView.findViewById(R.id.newemailpopup_name);
|
|
|
|
+ newemail_email = (EditText) emailPopupView.findViewById(R.id.newemailpopup_email);
|
|
|
|
+ newemail_password = (EditText) emailPopupView.findViewById(R.id.newemailpopup_password);
|
|
|
|
+
|
|
|
|
+ newemail_save_button = (Button) emailPopupView.findViewById(R.id.saveButton);
|
|
|
|
+ newemail_cancel_button = (Button) emailPopupView.findViewById(R.id.cancelButton);
|
|
|
|
+
|
|
|
|
+ dialogBuilder.setView(emailPopupView);
|
|
|
|
+ dialog = dialogBuilder.create();
|
|
|
|
+ dialog.show();
|
|
|
|
+
|
|
|
|
+ newemail_save_button.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ // define save button here
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ newemail_cancel_button.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ // define save button here
|
|
|
|
+ dialog.dismiss();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|