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.mo.activity; | |
| import android.app.ActionBar; | |
| import android.app.AlertDialog; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.DialogInterface; | |
| import android.content.Intent; | |
| import android.content.IntentFilter; | |
| import android.net.ConnectivityManager; |
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
| byte[] photoByteArray = Files.toByteArray(photo.getImageFile()); | |
| BlipoApi blipoApi = setUpNetwork(); | |
| blipoApi.uploadPhoto(photoByteArray); | |
| private BlipoApi setUpNetwork() { | |
| RequestInterceptor requestInterceptor = new RequestInterceptor() { | |
| @Override | |
| public void intercept(RequestFacade requestFacade) { | |
| String imageId = UUID.randomUUID().toString(); |
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
| Add new Branch to remote | |
| Git push -u origin <branch name> | |
| Push branch to remote repository | |
| Origin is the name of the repository | |
| Git push origin localBranchName:newBranchName | |
| Add new branch with new name from local |
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 MainActivity extends Activity implements ConnectivityDialogFragment.ConnectionDialogInterface { | |
| //region Variables | |
| private static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE"; | |
| private static final String DIALOG_FRAGMENT = "dialog_fragment"; | |
| private ConnectivityReceiver mConnectivityReceiver; | |
| private IntentFilter mFilter; | |
| //endregion |
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 SuggestionsAdapter extends ResourceCursorAdapter { | |
| public MatrixCursor mResult = new MatrixCursor(new String[] { "_id", "s" }); | |
| boolean mIsEnabled = true; | |
| private Context mContext; | |
| public SuggestionsAdapter(Context context, int layout) { | |
| super(context, layout, null); | |
| } |
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.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 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 EndlessScrollListener implements AbsListView.OnScrollListener { | |
| private int visibleThreshold = 3; | |
| private int currentPage = 0; | |
| private int currentTotalItems = 0; | |
| private int firstItemPageIndex = 0; | |
| private boolean loading = false; | |
| private OnLoadMoreListener loadMoreListener; |
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 SaleListsAdapter extends ArrayAdapter<Product> { | |
| public SaleListsAdapter(Context context, int resource, List<Product> objects) { | |
| super(context, resource, objects); | |
| } | |
| public SaleListsAdapter(Context context, int resource, int textViewResourceId, List<Patient> objects) { | |
| super(context, resource, textViewResourceId, objects); | |
| } |
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; |
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); |