This file contains hidden or 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
// Check permission,... | |
// View image or download | |
$filePath = '/data/.../demo-image.jpg'; | |
$name = basename($filePath); | |
if($params['mode'] == 'view'){ | |
header("Content-Type: " . mime_content_type($filePath)); | |
header('Content-disposition: inline; filename="' . $name . '"'); | |
} else { | |
header("Content-Type: application/octet-stream"); |
This file contains hidden or 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
final static String DATABASE_NAME = "your-database-name"; | |
final static String FOLDER_EXTERNAL_DIRECTORY = Environment.getExternalStorageDirectory() + "/folder"; | |
//______________________________________________________________________________________________ | |
/** | |
* Call this method from any activity in your app ( | |
* for example -> DatabaseUtil.copyDatabaseToExtStg(MainActivity.this); | |
* this method will copy the database of your application into SDCard folder "shanraisshan/MyDatabase.sqlite" (DATABASE_NAME) | |
*/ |
This file contains hidden or 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 MoneyFormatEditText extends EditText { | |
public MoneyFormatEditText(Context context) { | |
super(context); | |
setupTextWatcher(); | |
} | |
public MoneyFormatEditText(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
setupTextWatcher(); | |
} |
This file contains hidden or 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
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import com.kbeanie.imagechooser.api.ChooserType; | |
import com.kbeanie.imagechooser.api.ChosenImage; | |
import com.kbeanie.imagechooser.api.ChosenImages; | |
import com.kbeanie.imagechooser.api.ImageChooserListener; | |
import com.kbeanie.imagechooser.api.ImageChooserManager; |
This file contains hidden or 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
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.AbsListView; | |
import android.widget.BaseAdapter; | |
import android.widget.HeaderViewListAdapter; | |
import android.widget.ListView; | |
public class LoadMoreListView extends ListView implements AbsListView.OnScrollListener { | |
private OnLoadMorListener onLoadMorListener; |
This file contains hidden or 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
import android.content.Context; | |
import android.text.Editable; | |
import android.text.TextUtils; | |
import android.text.TextWatcher; | |
import android.text.method.DigitsKeyListener; | |
import android.util.AttributeSet; | |
import android.view.inputmethod.EditorInfo; | |
import android.widget.EditText; |
This file contains hidden or 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
/** | |
* Modified MIT License | |
* | |
* Copyright 2015 OneSignal | |
* | |
* 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 |
This file contains hidden or 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
import java.util.Date; | |
import android.content.res.Resources; | |
public class TimeAgo { | |
public static String timeAgo(Date date) { | |
return timeAgo(date.getTime()); | |
} |
This file contains hidden or 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
import android.util.Log; | |
import vn.mog.mygimi.BuildConfig; | |
/** | |
* Created by VAdaihiep on 11/11/2015. | |
*/ | |
public class MyLog { | |
public static String DEFAULT_TAG = "VAdaihiep"; |
This file contains hidden or 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 vn.vadaihiep.keepstatefragment; | |
import android.app.ProgressDialog; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.support.v4.app.Fragment; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import android.view.LayoutInflater; |
NewerOlder