diff --git a/.androidide/editor/openedFiles.json b/.androidide/editor/openedFiles.json new file mode 100644 index 0000000..d79a5c1 --- /dev/null +++ b/.androidide/editor/openedFiles.json @@ -0,0 +1,20 @@ +{ + "allFiles": [ + { + "file": "/storage/emulated/0/AndroidIDEProjects/GoogleDictionary/app/src/main/java/qz/userdictionary/MainActivity.java", + "selection": { + "end": { + "column": 0, + "index": 0, + "line": 0 + }, + "start": { + "column": 0, + "index": 0, + "line": 0 + } + } + } + ], + "selectedFile": "/storage/emulated/0/AndroidIDEProjects/GoogleDictionary/app/src/main/java/qz/userdictionary/MainActivity.java" +} \ No newline at end of file diff --git a/app/src/main/java/qz/userdictionary/MainActivity.java b/app/src/main/java/qz/userdictionary/MainActivity.java index 3528c91..bfc21f8 100644 --- a/app/src/main/java/qz/userdictionary/MainActivity.java +++ b/app/src/main/java/qz/userdictionary/MainActivity.java @@ -3,16 +3,10 @@ import android.os.Handler; import android.os.Looper; import android.provider.UserDictionary; -import java.util.Dictionary; import qz.userdictionary.ViewModel.Dialogs; -import java.util.Dictionary; -import android.content.Intent; -import android.graphics.Color; -import android.provider.Settings; import android.text.Editable; import android.text.TextWatcher; -import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import androidx.recyclerview.widget.LinearLayoutManager; @@ -78,9 +72,13 @@ public void afterTextChanged(Editable arg0) {} (v) -> { String kata = binding.checkleng.getText().toString(); String keys = binding.keys.getText().toString(); - + addData( - new TextItems(kata, keys, "250",String.valueOf(UserDictionary.Words.LOCALE_TYPE_ALL))); + new TextItems( + kata, + keys, + "250", + String.valueOf(UserDictionary.Words.LOCALE_TYPE_ALL))); }); binding.clearAll.setOnClickListener( @@ -97,9 +95,9 @@ void ClearAllDictionary() { void addData(TextItems item) { textitem.clear(); - + dictionary.add(item); - + textitem.addAll(dictionary.getListItem()); adapter.notifyDataSetChanged(); } diff --git a/app/src/main/java/qz/userdictionary/Model/UserDictionaryHelper.java b/app/src/main/java/qz/userdictionary/Model/UserDictionaryHelper.java index aafd597..044f092 100644 --- a/app/src/main/java/qz/userdictionary/Model/UserDictionaryHelper.java +++ b/app/src/main/java/qz/userdictionary/Model/UserDictionaryHelper.java @@ -4,15 +4,11 @@ import android.content.ContentValues; import android.content.Context; import android.database.Cursor; -import android.net.Uri; import android.provider.UserDictionary; import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; import java.util.ArrayList; -import java.util.Dictionary; import java.util.List; -import java.util.Locale; -import qz.userdictionary.Model.TextItems; public class UserDictionaryHelper { Context appid; diff --git a/app/src/main/java/qz/userdictionary/ViewModel/DialogEdit.java b/app/src/main/java/qz/userdictionary/ViewModel/DialogEdit.java index 18076a1..7020ba0 100644 --- a/app/src/main/java/qz/userdictionary/ViewModel/DialogEdit.java +++ b/app/src/main/java/qz/userdictionary/ViewModel/DialogEdit.java @@ -3,8 +3,6 @@ import android.content.Context; import android.content.DialogInterface; import android.view.LayoutInflater; -import android.view.View; -import android.widget.Toast; import androidx.appcompat.app.AlertDialog; import qz.userdictionary.Model.TextItems; import qz.userdictionary.Model.UserDictionaryHelper; diff --git a/app/src/main/java/qz/userdictionary/ViewModel/Dialogs.java b/app/src/main/java/qz/userdictionary/ViewModel/Dialogs.java index 970c9fa..e9233aa 100644 --- a/app/src/main/java/qz/userdictionary/ViewModel/Dialogs.java +++ b/app/src/main/java/qz/userdictionary/ViewModel/Dialogs.java @@ -4,9 +4,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.provider.Settings; -import android.widget.Toast; import androidx.appcompat.app.AlertDialog; -import qz.userdictionary.ViewModel.Dialogs; import qz.userdictionary.R; public class Dialogs extends AlertDialog.Builder implements DialogInterface.OnClickListener { diff --git a/app/src/main/java/qz/userdictionary/ViewModel/mAdpView.java b/app/src/main/java/qz/userdictionary/ViewModel/mAdpView.java index 8e3be2c..c8bf2cb 100644 --- a/app/src/main/java/qz/userdictionary/ViewModel/mAdpView.java +++ b/app/src/main/java/qz/userdictionary/ViewModel/mAdpView.java @@ -1,21 +1,16 @@ package qz.userdictionary.ViewModel; -import android.content.Context; import android.database.ContentObserver; import android.net.Uri; import android.os.Handler; -import android.os.Looper; import android.provider.UserDictionary; import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.Toast; import androidx.recyclerview.widget.RecyclerView; -import java.util.ArrayList; import java.util.List; import qz.userdictionary.Model.TextItems; import qz.userdictionary.Model.UserDictionaryHelper; -import qz.userdictionary.ViewModel.DialogEdit; -import qz.userdictionary.ViewModel.mAdpView; import qz.userdictionary.databinding.CostumViewTextitemBinding; public class mAdpView extends RecyclerView.Adapter { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 103d408..05b7fc7 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,77 +1,78 @@ + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:padding="5dp" + android:orientation="vertical"> + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:hint="@string/input_panjang"> + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:inputType="number" + android:id="@+id/tergetAngka" /> + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:hint="@string/input_keys"> + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:id="@+id/keys" /> + android:elevation="5dp"> + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:id="@+id/checkleng" /> + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:gravity="center" + android:orientation="horizontal">