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 CancelableCallback<T> implements Callback<T> { | |
| private Callback<T> callback; | |
| private boolean canceled; | |
| public CancelableCallback(Callback<T> callback) { | |
| this.callback = callback; | |
| canceled = false; | |
| } |
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 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 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
| Object[] o = in.readArray(Question.class.getClassLoader()); | |
| ArrayList<mAttribute> ps = new ArrayList<Attribute>(); | |
| for (Object item : o) { | |
| ps.add(((Attribute) item)); | |
| } | |
| setAttributes(ps); |
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
| JsonObject jsonObject = JsonObject.readFrom(var); | |
| JsonArray jsonArray = jsonObject.getJsonArray("param_name"); | |
| String type = jsonValue.asObject().getString("param_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 PhotoQuestionAnswer extends FrameLayout { | |
| @InjectView(R.id.photo) PicassoImageView photoIv; | |
| public PhotoQuestionAnswer(Context context) { | |
| this(context, null); | |
| } | |
| public PhotoQuestionAnswer(Context context, AttributeSet attrs) { | |
| this(context, attrs, 0); |
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 static File createExternalStoragePrivateFile(Context context, byte[] bytes, String fileName) { | |
| deleteExternalStoragePrivateFile(context, fileName); | |
| File file = new File(context.getExternalFilesDir(Environment.DIRECTORY_PICTURES), fileName); | |
| try { | |
| OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(file)); | |
| outputStream.write(bytes); | |
| outputStream.flush(); |
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 com.kuapay.android.kuaClass; | |
| import android.content.Context; | |
| import android.content.SharedPreferences; | |
| import com.kuapay.android.manager.UserManager; | |
| public class DefaultTip | |
| { | |
| //region Constant Variables | |
| private static final String TIP_SETTINGS = "tip_settings"; |
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
| @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 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
| 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 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 butterknife.ButterKnife; | |
| import butterknife.InjectView; | |
| import butterknife.OnClick; | |
| public class ButtonFooterView extends LinearLayout implements TreatmentView { | |
| //region Variables | |
| @InjectView(R.id.title_tv) TextView titleTextView; | |
| @InjectView(R.id.footer_bt) Button footerButton; |