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
import java.io.IOException; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Type; | |
import okhttp3.MediaType; | |
import okhttp3.RequestBody; | |
import okhttp3.ResponseBody; | |
import retrofit2.Converter; | |
import retrofit2.Retrofit; |
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
mView.getViewTreeObserver().addOnGlobalLayoutListener( | |
new ViewTreeObserver.OnGlobalLayoutListener() { | |
public void onGlobalLayout() { | |
int width = mView.getWidth(); | |
int height = mView.getHeight(); | |
if (mView.getViewTreeObserver().isAlive()) { | |
// remove this layout listener | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { |
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
import android.content.Context; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.provider.MediaStore; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ImageView; | |
import android.widget.ResourceCursorAdapter; | |
import android.widget.TextView; |
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
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { | |
return new CursorLoader(getActivity(), | |
// Retrieve data rows for the device user's 'profile' contact. | |
Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI, | |
ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION, | |
// Select only email addresses. | |
ContactsContract.Contacts.Data.MIMETYPE + | |
" = ?", new String[]{ContactsContract.CommonDataKinds.Email | |
.CONTENT_ITEM_TYPE}, |
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 final class Api { | |
//region Variables | |
private static final String API_HOST = Application.string(R.string.api_server); | |
private static final Object sLockObject = new Object(); | |
private static Service sService = null; | |
static final int DISK_CACHE_SIZE = 50 * 1024 * 1024; // 50MB | |
//endregion |
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.kuapay.library.fragment; | |
import android.app.Activity; | |
import android.app.Dialog; | |
import android.os.Bundle; | |
import android.support.v4.app.DialogFragment; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.view.Window; |
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.kuapay.library.helperClass; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
public class DefaultTipHelper | |
{ | |
//region Constant Variables | |
private static final String TIP_SETTING = "tip_setting"; | |
private static final String DEFAULT_TIP = "0"; |
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
Intent imageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); | |
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); | |
String filePath = Environment.getExternalStoragePublicDirectory( | |
Environment.DIRECTORY_DCIM).toString()+"/Camera"; | |
File rootFolder = new File(filePath); | |
File image = new File(rootFolder, "bp_" + timeStamp + ".png"); | |
Uri uriSavedImage = Uri.fromFile(image); |
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.sf.photointake.intake.model; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import com.google.gson.annotations.SerializedName; | |
import java.io.Closeable; | |
import java.io.IOException; | |
import java.util.ArrayList; |
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
Object[] o = in.readArray(Question.class.getClassLoader()); | |
ArrayList<mAttribute> ps = new ArrayList<Attribute>(); | |
for (Object item : o) { | |
ps.add(((Attribute) item)); | |
} | |
setAttributes(ps); |
NewerOlder