Skip to content

Instantly share code, notes, and snippets.

View mwshubham's full-sized avatar
✌️
Peace

ShubhAm AgaRwal mwshubham

✌️
Peace
View GitHub Profile
@mwshubham
mwshubham / RetrofitClient.java
Created July 23, 2017 01:07
Android : Retrofit Client Demo
/**
* Created by shubham on 21/7/17.
*/
public class RetrofitClient {
private static Retrofit sRetrofit = null;
@SuppressLint("StaticFieldLeak")
private static Context sContext;
public static Retrofit getClient(Context context) {
if (sRetrofit == null) {
@mwshubham
mwshubham / MyDongerList.java
Created July 23, 2017 14:24
My Donger list
ᕙ(⇀‸↼‶)ᕗ
(๑ᴥ๑ )
━╤デ╦︻(▀̿̿Ĺ̯̿̿▀̿ ̿)
(ノಠ益ಠ)ノ彡┻━┻|
¯\_(ツ)_/¯
@mwshubham
mwshubham / CategoryContract.java
Created July 31, 2017 00:53
CategoryContract
public final class CategoryContract {
@SuppressWarnings("unused")
private static final String TAG = "CategoryContract";
private CategoryContract() {
}
public static class CategoryEntry implements BaseColumns {
@SuppressWarnings("unused")
@mwshubham
mwshubham / CategoryDbHelper.java
Created July 31, 2017 01:05
CategoryDbHelper
public class CategoryDbHelper extends SQLiteOpenHelper {
@SuppressWarnings("unused")
private static final String TAG = "CategoryDbHelper";
private static final String SQL_CREATE_CATEGORY_ENTRIES = "CREATE TABLE " + CategoryContract.CategoryEntry.TABLE_NAME + " ("
+ CategoryContract.CategoryEntry._ID + " INTEGER PRIMARY KEY,"
+ CategoryContract.CategoryEntry.COLUMN_NAME_ID + " TEXT,"
+ CategoryContract.CategoryEntry.COLUMN_NAME_DESCRIPTION + " TEXT,"
+ CategoryContract.CategoryEntry.COLUMN_NAME_NAME + " TEXT,"
@Database(entities = {CategoryData.class}, version = DATABASE_VERSION)
public abstract class AppDatabase extends RoomDatabase {
private static AppDatabase INSTANCE;
/*Database Constant*/
@SuppressWarnings("WeakerAccess")
public final static int DATABASE_VERSION = 1;
public final static String DATABASE_NAME = "App.db";
@Dao
public interface CategoryDao {
@Query("SELECT * FROM " + AppDatabase.CATEGORY_TABLE_NAME)
List<CategoryData> getAll();
@Insert(onConflict = OnConflictStrategy.REPLACE)
void insertAll(List<CategoryData> categories);
@Insert(onConflict = OnConflictStrategy.REPLACE)
/**
* Created by shubham on 22/7/17.
*/
@Entity(tableName = CATEGORY_TABLE_NAME)
public class CategoryData {
@SuppressWarnings("unused")
private static final String TAG = "CategoryData";
@PrimaryKey
/**
* Created by shubham on 22/7/17.
*/
@Entity(tableName = CATEGORY_TABLE_NAME)
public class CategoryData {
@SuppressWarnings("unused")
private static final String TAG = "CategoryData";
@PrimaryKey
@mwshubham
mwshubham / customized_state_animator.xml
Created October 12, 2017 20:03
Android Depressed Button Style
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true">
<set>
<objectAnimator android:duration="100" android:propertyName="translationZ" android:valueTo="4dp" android:valueType="floatType" />
</set>
</item>
<!-- base state -->
<item android:state_enabled="true">
<set>
@mwshubham
mwshubham / filterRegex
Last active October 16, 2017 12:43
[UPDATED] FILTER CONFIGRATION VIA TAG
^(?!(InputMethodManager|SurfaceView|SettingsInterface|SettingsInterface|NativeCrypto|System.out|libc-netbsd|Posix|WindowClient|ViewRootImpl|Surface|GraphicBuffer|Camera-JNI|FA|ActivityThread|View|CameraFramework|OpenSSLLib|skia|Bitmap|[MALI][Gralloc]|AudioTrack|AudioSystem|IJKMEDIA|J4A|art|System|MiniThumbFile|PhoneWindow|MediaStore|IInputConnectionWrapper|OpenGLRenderer|SQLiteDatabase|[MALI][Gralloc]|mali_winsys|NativeCrypto|ProgramBinary|RenderScript))