Skip to content

Commit

Permalink
Hapus Import yang tidak digunakan
Browse files Browse the repository at this point in the history
  • Loading branch information
QiubyZ committed Feb 7, 2024
1 parent 9767093 commit d994eff
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 66 deletions.
20 changes: 20 additions & 0 deletions .androidide/editor/openedFiles.json
Original file line number Diff line number Diff line change
@@ -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"
}
18 changes: 8 additions & 10 deletions app/src/main/java/qz/userdictionary/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand All @@ -97,9 +95,9 @@ void ClearAllDictionary() {

void addData(TextItems item) {
textitem.clear();

dictionary.add(item);

textitem.addAll(dictionary.getListItem());
adapter.notifyDataSetChanged();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/qz/userdictionary/ViewModel/DialogEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/qz/userdictionary/ViewModel/Dialogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/java/qz/userdictionary/ViewModel/mAdpView.java
Original file line number Diff line number Diff line change
@@ -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<mAdpView.VH> {
Expand Down
87 changes: 44 additions & 43 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,77 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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">
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">

<com.google.android.material.textfield.TextInputLayout
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:hint="@string/input_panjang">

<com.google.android.material.textfield.TextInputEditText
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/tergetAngka" />
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="number"
android:id="@+id/tergetAngka" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
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:hint="@string/input_keys">

<com.google.android.material.textfield.TextInputEditText
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/keys" />
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/keys" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/view_counter"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:hint="@string/input_words"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:hint="@string/input_words"
app:counterEnabled="true"
android:elevation="5dp">
android:elevation="5dp">

<com.google.android.material.textfield.TextInputEditText
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:id="@+id/checkleng" />

</com.google.android.material.textfield.TextInputLayout>


<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center"
android:orientation="horizontal">
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center"
android:orientation="horizontal">

<Button
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="1"
android:text="Add"
android:id="@+id/add" />
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="1"
android:text="Add"
android:id="@+id/add" />

<Button
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="1"
android:text="Delete All Dictionary"
android:id="@+id/clearAll" />
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="1"
android:text="Delete All Dictionary"
android:id="@+id/clearAll" />

</LinearLayout>

<androidx.recyclerview.widget.RecyclerView
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/recyclerView" />
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/recyclerView" />

</LinearLayout>
</LinearLayout>

0 comments on commit d994eff

Please sign in to comment.