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
| //Use this code to get Device's height and width and save them to variable, like this | |
| DisplayMetrics displaymetrics = new DisplayMetrics(); | |
| getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); | |
| int height = displaymetrics.heightPixels; | |
| int width = displaymetrics.widthPixels; | |
| //After getting your X and Y use below mentioned function to get percentage | |
| int percentageX= (int)((x*100)/width) | |
| int percentageY= (int)((y*100)/height) |
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
| ------------------------------------------------------------------------------------------------------------------------------ | |
| TransparentProgressDialog.java | |
| public class TransparentProgressDialog extends Dialog { | |
| private ImageView iv; | |
| public TransparentProgressDialog(Context context, int resourceIdOfImage) { | |
| super(context, R.style.TransparentProgressDialog); | |
| WindowManager.LayoutParams wlmp = getWindow().getAttributes(); |
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 CommonFunctions { | |
| public static final AtomicInteger sNextGeneratedId = new AtomicInteger(1); | |
| public static Activity context; | |
| /*********************************************Network Check*********************************/ | |
| public static boolean isOnline(Activity _context) { | |
| context=_context; |
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 CustomTV_Sam_bold extends TextView { | |
| Context context; | |
| public CustomTV_Sam_bold(Context context, AttributeSet attrs, int defStyle) { | |
| super(context, attrs, defStyle); | |
| this.context = context; | |
| init(); | |
| } | |
| public CustomTV_Sam_bold(Context context, AttributeSet attrs) { | |
| super(context, attrs); |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- Application theme --> | |
| <style name="AppTheme" parent="Theme.AppCompat.Light"> | |
| <item name="android:windowBackground">@color/main_color</item> | |
| </style> | |
| <style name="AppTheme.RootView"> |
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.widget.Toast; | |
| /** | |
| * Some utility methods related with the Toast class. | |
| * | |
| * @author Devrath | |
| */ | |
| public class ToastUtils { |
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.godiswithme.Utils; | |
| import android.app.Activity; | |
| import android.content.Intent; | |
| import android.graphics.Color; | |
| import android.support.design.widget.Snackbar; | |
| import android.view.View; | |
| import com.godiswithme.R; |
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
| protected int UpdateDimens(String imageName) | |
| { | |
| int identifier = getResources().getIdentifier(imageName, "dimens",getPackageName()); | |
| //int strId = getResources().getIdentifier(imageName, "string", getPackageName()); | |
| System.out.println(">>>>>>"+identifier); | |
| try { | |
| return identifier; | |
| } catch (Exception e) { | |
| // TODO: handle exception | |
| e.printStackTrace(); |
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
| // In the OnCreate Method Start a background thread | |
| new LongOperation().execute(""); | |
| private class LongOperation extends AsyncTask<String, Integer, String> { | |
| @Override | |
| protected void onPreExecute() { |
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
| surface_view_camera_fragment.xml | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:id="@+id/main_layout" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent"> | |
| <LinearLayout | |
| android:layout_width="match_parent" |