Skip to content

Commit

Permalink
LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
QiubyZ committed Feb 8, 2024
1 parent 012a77f commit e2a78fe
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 26 deletions.
20 changes: 0 additions & 20 deletions .androidide/editor/openedFiles.json

This file was deleted.

9 changes: 9 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2024 Qiuby Zhukhi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 changes: 32 additions & 6 deletions app/src/main/java/qz/userdictionary/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.os.Handler;
import android.os.Looper;
import android.provider.UserDictionary;
import android.widget.Toast;
import qz.userdictionary.ViewModel.Dialogs;

import android.text.Editable;
Expand Down Expand Up @@ -31,27 +32,52 @@ protected void onCreate(Bundle savedInstanceState) {

// Inflate and get instance of binding
binding = ActivityMainBinding.inflate(getLayoutInflater());

// set content view to binding's root
setContentView(binding.getRoot());
if(getIntent() != null) {
if (getIntent() != null) {
String words = getIntent().getStringExtra(Intent.EXTRA_PROCESS_TEXT);
binding.checkleng.setText(words);
}

textitem = new ArrayList<TextItems>();
adapter = new mAdpView(textitem, new Handler(Looper.getMainLooper()));
dictionary = new UserDictionaryHelper(this);

binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
binding.recyclerView.setAdapter(adapter);

// binding.keys.setText("coba");
// binding.checkleng.setText("makan ikan tapi nete");
//
// binding.keys.setText("coba");
// binding.checkleng.setText("makan ikan tapi nete");
//
textitem.addAll(dictionary.getListItem());
adapter.notifyDataSetChanged();
binding.tergetAngka.addTextChangedListener(
new TextWatcher() {

@Override
public void beforeTextChanged(
CharSequence arg0, int arg1, int arg2, int arg3) {}

@Override
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
try {
if(Integer.valueOf(binding.tergetAngka.getText().toString()) != null){
if(Integer.valueOf(binding.tergetAngka.getText().toString()) > 101){
binding.tergetAngka.setError("Aturan Google panjang kata tidak lebih dari 101");
}
}
} catch(Exception err) {
Toast.makeText(binding.getRoot().getContext(), err.toString(), Toast.LENGTH_LONG).show();
}

}
@Override
public void afterTextChanged(Editable arg0) {

}
});

binding.checkleng.addTextChangedListener(
new TextWatcher() {

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="number"
app:counterMaxLength="101"
app:errorEnabled="true"
android:id="@+id/tergetAngka" />

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

0 comments on commit e2a78fe

Please sign in to comment.