This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mlpt.siemo.mobilebanking.riau.utils; | |
import android.Manifest; | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.os.Build; | |
import android.provider.Settings; | |
import android.telephony.SubscriptionInfo; | |
import android.telephony.SubscriptionManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
public static final String TAG = "Main_Activity"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
public static final String TAG = "Main_Activity"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
//check NFC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AdapterCreator<MyModel> adapter = new AdapterBuilder<MyModel>(R.layout.rv_item) | |
.onBind( ... ) | |
.onFilter(new FilterCallBack<MyModel>() { | |
@Override | |
public List<MyModel> performFiltering(CharSequence constraint, List<MyModel> listFilter) { | |
List<MyModel> fildteredList = new ArrayList<>(); | |
if (constraint != null || constraint.length() != 0) { | |
String filterPattern = constraint.toString().toLowerCase().trim(); | |
for (MyModel item : listFilter) { | |
//filter by id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
AdapterCreatorMultiType<MyModel> adapter = new AdapterBuilderMultiType<MyModel>() | |
.setList(list) | |
.onBind(new BindViewHolderMultiType<MyModel>() { | |
//your constant type | |
private final int TYPE_GENAP = 1; | |
private final int TYPE_GANJIL = 0; | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//setup data | |
List<MyModel> list = new ArrayList<>(); | |
for (int i = 0; i < 10; i++) { | |
list.add(new MyModel(i,"Data Ke "+ (i + 1))); | |
} | |
//setup adapter | |
AdapterCreator<MyModel> adapter = new AdapterBuilder<MyModel>(R.layout.rv_item) | |
.setList(list) | |
.onBind(new BindViewHolder<MyModel>() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EditText editText = findViewById(R.id.ed); | |
editText.addTextChangedListener(new SimpleTextWatcher(new AfterTextChanged() { | |
@Override | |
public void afterTextChanged(Editable s) { | |
//do something | |
} | |
})); | |
editText.addTextChangedListener(new SimpleTextWatcher(new BeforeTextChanged() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// build.gradle project | |
allprojects { | |
repositories { | |
... | |
maven { url 'https://jitpack.io' } | |
} | |
} | |
// build.gradle app/module | |
dependencies { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EditText editText = findViewById(R.id.ed); | |
editText.addTextChangedListener(new SimpleTextWatcher(new AfterTextChanged() { | |
@Override | |
public void afterTextChanged(Editable s) { | |
//do something | |
} | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EditText editText = findViewById(R.id.ed); | |
editText.addTextChangedListener(new TextWatcher() { | |
@Override | |
public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
} | |
@Override | |
public void onTextChanged(CharSequence s, int start, int before, int count) { |