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
<!-- Manifest.xml --> | |
<manifest> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<!-- Camera --> | |
<uses-feature android:name="android.hardware.camera" | |
android:required="false" /> | |
<uses-permission android:name="android.permission.CAMERA" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
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 void showWaContact(){ | |
try{ | |
String contactWaNumber = "6281363009995"; | |
Intent sendIntent = new Intent("android.intent.action.MAIN"); | |
sendIntent.setComponent(new ComponentName("com.whatsapp","com.whatsapp.Conversation")); | |
sendIntent.putExtra("jid", contactWaNumber+"@s.whatsapp.net"); | |
startActivity(sendIntent); | |
}catch (Exception e){ | |
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.whatsapp"))); | |
} |
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
void setDropDownView(AutoCompleteTextView autoCompleteTextView){ | |
int paddingBottom = autoCompleteTextView.getPaddingBottom(); | |
int paddingStart = ViewCompat.getPaddingStart(autoCompleteTextView); | |
int paddingEnd = ViewCompat.getPaddingEnd(autoCompleteTextView); | |
int paddingTop = autoCompleteTextView.getPaddingTop(); | |
ViewCompat.setBackground(autoCompleteTextView, null); | |
ViewCompat.setPaddingRelative(autoCompleteTextView, paddingStart, | |
paddingTop, paddingEnd, paddingBottom); | |
} |
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
//the idea is to cut the slash / strip | |
//or do DATE (SUBSTR("TIMESTAMP_COLUMN_NAME+"1,11)) = DATE('now') | |
public static String getCurrentTimeStamp() { | |
java.util.Date date = new java.util.Date(); | |
Timestamp timestamp = new Timestamp(date.getTime()); | |
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
String formattedDate = df.format(date); | |
return formattedDate; | |
} |
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
void setDropDownView(AutoCompleteTextView autoCompleteTextView){ | |
int paddingBottom = autoCompleteTextView.getPaddingBottom(); | |
int paddingStart = ViewCompat.getPaddingStart(autoCompleteTextView); | |
int paddingEnd = ViewCompat.getPaddingEnd(autoCompleteTextView); | |
int paddingTop = autoCompleteTextView.getPaddingTop(); | |
ViewCompat.setBackground(autoCompleteTextView, null); | |
ViewCompat.setPaddingRelative(autoCompleteTextView, paddingStart, | |
paddingTop, paddingEnd, paddingBottom); | |
} |
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 static void e(Object object, String message){ | |
Class<?> classObj = object.getClass(); | |
android.util.Log.d(classObj.getSimpleName(), " - "+message); | |
} |
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.infield.epms.view; | |
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import com.afollestad.materialdialogs.DialogAction; | |
import com.afollestad.materialdialogs.MaterialDialog; | |
import com.infield.epms.R; | |
public class BaseMaterialDialog { |
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 edit_text; | |
OnEditTextSearchListener listener; | |
String tempText; | |
//in case if it is using honeywell keypad... | |
int lengthBefore = 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
<?xml version="1.0" encoding="utf-8"?> | |
<CheckedTextView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:paddingLeft="@dimen/padding_tiny" | |
android:paddingRight="@dimen/padding_tiny" | |
android:paddingTop="@dimen/padding_small" | |
android:paddingBottom="@dimen/padding_small" | |
android:ellipsize="end" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"/> |
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 IntegerInputFilter implements InputFilter { | |
private Pattern pattern = Pattern.compile("^(?!0{1,})\\d+(?:\\.\\d+)?$"); | |
//or ..{1,}.. | |
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { | |
//Log.e("word "+source+ " "+dest); | |
Matcher matcher = pattern.matcher(dest.toString()+source.toString()); | |
//you can handle with length == 1 return null; | |
if(!matcher.matches()){ |
OlderNewer