cleanup
This commit is contained in:
+7
-7
@@ -30,11 +30,11 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
implementation 'com.google.android.material:material:1.1.0'
|
implementation 'com.google.android.material:material:1.3.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
testImplementation 'junit:junit:4.+'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||||
implementation 'com.android.support:design:28.0.0'
|
implementation 'com.google.android.material:material:1.3.0'
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="de.joel.zoomhelper">
|
package="de.joel.zoomhelper">
|
||||||
|
<queries>
|
||||||
|
<package android:name="us.zoom.videomeetings" />
|
||||||
|
</queries>
|
||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|||||||
@@ -1,28 +1,23 @@
|
|||||||
package de.joel.zoomhelper;
|
package de.joel.zoomhelper;
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.Animation;
|
|
||||||
import android.view.animation.AnimationUtils;
|
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.AutoCompleteTextView;
|
import android.widget.AutoCompleteTextView;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ListPopupWindow;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
@@ -33,7 +28,7 @@ import java.io.Serializable;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
class InstantAutoComplete extends AutoCompleteTextView {
|
class InstantAutoComplete extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
|
||||||
|
|
||||||
public InstantAutoComplete(Context context) {
|
public InstantAutoComplete(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -66,8 +61,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
catch (IndexOutOfBoundsException e) {
|
catch (IndexOutOfBoundsException e) {
|
||||||
AlertDialog.Builder dialog=new AlertDialog.Builder(this);
|
AlertDialog.Builder dialog=new AlertDialog.Builder(this);
|
||||||
dialog.setMessage("Daten wurden zurückgesetzt, da die Config-Struktur nochmal verändert wurde.");
|
dialog.setMessage(R.string.resetDataText);
|
||||||
dialog.setTitle("Hinweis");
|
dialog.setTitle(R.string.hint);
|
||||||
AlertDialog alertDialog=dialog.create();
|
AlertDialog alertDialog=dialog.create();
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
setLastMeeting(-1);
|
setLastMeeting(-1);
|
||||||
@@ -83,9 +78,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private void watchShareIcon() {
|
private void watchShareIcon() {
|
||||||
ImageView ShareIcon = findViewById(R.id.imageShare);
|
ImageView ShareIcon = findViewById(R.id.imageShare);
|
||||||
ShareIcon.setOnClickListener(v -> {
|
ShareIcon.setOnClickListener(v -> shareMeeting(createCurrMeetingFromUI()));
|
||||||
shareMeeting(createCurrMeetingFromUI());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void shareMeeting(Meeting meeting) {
|
private void shareMeeting(Meeting meeting) {
|
||||||
@@ -100,23 +93,17 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private void watchNewIcon() {
|
private void watchNewIcon() {
|
||||||
ImageView AddIcon = findViewById(R.id.imageAdd);
|
ImageView AddIcon = findViewById(R.id.imageAdd);
|
||||||
AddIcon.setOnClickListener(v -> {
|
AddIcon.setOnClickListener(v -> fillBlank());
|
||||||
fillBlank();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void watchAttIcon() {
|
private void watchAttIcon() {
|
||||||
ImageView AttIcon = findViewById(R.id.imageAttend);
|
ImageView AttIcon = findViewById(R.id.imageAttend);
|
||||||
AttIcon.setOnClickListener(v -> {
|
AttIcon.setOnClickListener(v -> btnJoin_onClick(null));
|
||||||
btnJoin_onClick(null);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void watchDeleteIcon() {
|
private void watchDeleteIcon() {
|
||||||
ImageView trashIcon = findViewById(R.id.imageTrash);
|
ImageView trashIcon = findViewById(R.id.imageTrash);
|
||||||
trashIcon.setOnClickListener(v -> {
|
trashIcon.setOnClickListener(v -> removeMeeting(getLastMeeting()));
|
||||||
removeMeeting(getLastMeeting());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeMeeting(int meeting) {
|
private void removeMeeting(int meeting) {
|
||||||
@@ -160,9 +147,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private void watchSaveIcon() {
|
private void watchSaveIcon() {
|
||||||
ImageView saveIcon = findViewById(R.id.imageSave);
|
ImageView saveIcon = findViewById(R.id.imageSave);
|
||||||
saveIcon.setOnClickListener(v -> {
|
saveIcon.setOnClickListener(v -> saveAllMeetings());
|
||||||
saveAllMeetings();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void watchMeetingNameBox() {
|
public void watchMeetingNameBox() {
|
||||||
@@ -194,7 +179,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
AutoCompleteTextView textMeetingName = findViewById(R.id.TextMeetingName);
|
AutoCompleteTextView textMeetingName = findViewById(R.id.TextMeetingName);
|
||||||
ImageView dropdown = findViewById(R.id.image);
|
ImageView dropdown = findViewById(R.id.image);
|
||||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, meetingNames);
|
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, meetingNames);
|
||||||
textMeetingName.setAdapter(adapter);
|
textMeetingName.setAdapter(adapter);
|
||||||
|
|
||||||
textMeetingName.setOnTouchListener((View.OnTouchListener) (paramView, paramMotionEvent) -> {
|
textMeetingName.setOnTouchListener((View.OnTouchListener) (paramView, paramMotionEvent) -> {
|
||||||
@@ -203,9 +188,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
textMeetingName.setOnItemClickListener((arg0, view, arg2, arg3) -> {
|
textMeetingName.setOnItemClickListener((arg0, view, arg2, arg3) -> fillWithSelectedMeeting());
|
||||||
fillWithSelectedMeeting();
|
|
||||||
});
|
|
||||||
|
|
||||||
dropdown.setOnClickListener(v -> {
|
dropdown.setOnClickListener(v -> {
|
||||||
textMeetingName.showDropDown();
|
textMeetingName.showDropDown();
|
||||||
@@ -217,19 +200,17 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Meeting meeting = getMeetings().get(meetingIndex);
|
Meeting meeting = getMeetings().get(meetingIndex);
|
||||||
ArrayList<Attendee> attendees = meeting.attendees;
|
ArrayList<Attendee> attendees = meeting.attendees;
|
||||||
|
|
||||||
String attNames[] = new String[attendees.size()];
|
String[] attNames = new String[attendees.size()];
|
||||||
for (int i = 0; i < attendees.size(); i++) {
|
for (int i = 0; i < attendees.size(); i++) {
|
||||||
attNames[i] = attendees.get(i).name;
|
attNames[i] = attendees.get(i).name;
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoCompleteTextView textName = findViewById(R.id.textBoxName);
|
AutoCompleteTextView textName = findViewById(R.id.textBoxName);
|
||||||
ImageView dropdown = findViewById(R.id.image2);
|
ImageView dropdown = findViewById(R.id.image2);
|
||||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, attNames);
|
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, attNames);
|
||||||
textName.setAdapter(adapter);
|
textName.setAdapter(adapter);
|
||||||
|
|
||||||
textName.setOnItemClickListener((arg0, view, arg2, arg3) -> {
|
textName.setOnItemClickListener((arg0, view, arg2, arg3) -> fillWithSelectedAtt());
|
||||||
fillWithSelectedAtt();
|
|
||||||
});
|
|
||||||
|
|
||||||
dropdown.setOnClickListener(v -> {
|
dropdown.setOnClickListener(v -> {
|
||||||
textName.showDropDown();
|
textName.showDropDown();
|
||||||
@@ -291,6 +272,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
for (Object obj : listMeetings) {
|
for (Object obj : listMeetings) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (objOutputStream == null) throw new AssertionError();
|
||||||
objOutputStream.writeObject(obj);
|
objOutputStream.writeObject(obj);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -302,6 +284,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
if (objOutputStream == null) throw new AssertionError();
|
||||||
objOutputStream.close();
|
objOutputStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -313,7 +296,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
public ArrayList<Meeting> stringToMeetings(String string) {
|
public ArrayList<Meeting> stringToMeetings(String string) {
|
||||||
byte[] bytes = Base64.decode(string, 0);
|
byte[] bytes = Base64.decode(string, 0);
|
||||||
|
|
||||||
ArrayList<Meeting> listMeetings = new ArrayList();
|
ArrayList<Meeting> listMeetings = new ArrayList<>();
|
||||||
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
|
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
|
||||||
ObjectInputStream obj = null;
|
ObjectInputStream obj = null;
|
||||||
try {
|
try {
|
||||||
@@ -324,19 +307,19 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
try {
|
try {
|
||||||
while (bis.available() != -1) {
|
while (bis.available() != -1) {
|
||||||
//Read object from file
|
//Read object from file
|
||||||
|
if (obj == null) throw new AssertionError();
|
||||||
Meeting meeting = (Meeting) obj.readObject();
|
Meeting meeting = (Meeting) obj.readObject();
|
||||||
listMeetings.add(meeting);
|
listMeetings.add(meeting);
|
||||||
}
|
}
|
||||||
} catch (EOFException ex) {
|
} catch (EOFException ex) {
|
||||||
//ex.printStackTrace();
|
//ex.printStackTrace();
|
||||||
} catch (IOException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return listMeetings;
|
return listMeetings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ApplySharedPref")
|
||||||
public void saveMeetingList(ArrayList<Meeting> meetingList) {
|
public void saveMeetingList(ArrayList<Meeting> meetingList) {
|
||||||
SharedPreferences mPrefs = getPreferences(MODE_PRIVATE);
|
SharedPreferences mPrefs = getPreferences(MODE_PRIVATE);
|
||||||
SharedPreferences.Editor prefsEditor = mPrefs.edit();
|
SharedPreferences.Editor prefsEditor = mPrefs.edit();
|
||||||
@@ -344,6 +327,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
prefsEditor.commit();
|
prefsEditor.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ApplySharedPref")
|
||||||
public void setLastMeeting(int id) {
|
public void setLastMeeting(int id) {
|
||||||
SharedPreferences mPrefs = getPreferences(MODE_PRIVATE);
|
SharedPreferences mPrefs = getPreferences(MODE_PRIVATE);
|
||||||
SharedPreferences.Editor prefsEditor = mPrefs.edit();
|
SharedPreferences.Editor prefsEditor = mPrefs.edit();
|
||||||
@@ -399,8 +383,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
EditText editName = findViewById(R.id.textBoxName);
|
EditText editName = findViewById(R.id.textBoxName);
|
||||||
EditText editAtt = findViewById(R.id.editAtt);
|
EditText editAtt = findViewById(R.id.editAtt);
|
||||||
|
|
||||||
Meeting currMeeting = new Meeting(editMeetingName.getText().toString(), editID.getText().toString(), editPW.getText().toString(), editName.getText().toString(), editAtt.getText().toString());
|
return new Meeting(editMeetingName.getText().toString(), editID.getText().toString(), editPW.getText().toString(), editName.getText().toString(), editAtt.getText().toString());
|
||||||
return currMeeting;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveAllMeetings() {
|
public void saveAllMeetings() {
|
||||||
|
|||||||
@@ -12,5 +12,7 @@
|
|||||||
<string name="MeetingID">Meeting-ID:</string>
|
<string name="MeetingID">Meeting-ID:</string>
|
||||||
<string name="Password">Kenncode:</string>
|
<string name="Password">Kenncode:</string>
|
||||||
<string name="MeetingName">Meeting Name:</string>
|
<string name="MeetingName">Meeting Name:</string>
|
||||||
|
<string name="resetDataText">Daten wurden zurückgesetzt, da die Config-Struktur nochmal verändert wurde.</string>
|
||||||
|
<string name="hint">Hinweis</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user