TextView:
- Max Length with ellipsize at end
- Clear focus from EditText after open a screen
TextView:
| private fun getPicFromAsset(imageView: ImageView, assetName: String): Bitmap? { | |
| // Get the dimensions of the View | |
| val targetW = imageView.width | |
| val targetH = imageView.height | |
| if (targetW == 0 || targetH == 0) { | |
| // view has no dimensions set | |
| return null | |
| } |
| Drawable drawable = ContextCompat.getDrawable(this, R.drawable.ic_arrow_down_small).mutate(); | |
| ColorStateList colours = getResources().getColorStateList(R.color.arrow_down_selector); | |
| Drawable drawableCompat = DrawableCompat.wrap(drawable); | |
| DrawableCompat.setTintList(drawableCompat, colours); | |
| titleView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawableCompat , null); |
| @Override | |
| public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
| super.onCreateView(inflater, container, savedInstanceState); | |
| setHasOptionsMenu(true); | |
| } | |
| MenuItem menuItemCart; | |
| @Override |
| public class PDFTools { | |
| private static final String GOOGLE_DRIVE_PDF_READER_PREFIX = "http://drive.google.com/viewer?url="; | |
| private static final String PDF_MIME_TYPE = "application/pdf"; | |
| private static final String HTML_MIME_TYPE = "text/html"; | |
| public static void showPDFUrl( final Context context, final String pdfUrl ) { | |
| if ( isPDFSupported( context ) ) { | |
| downloadAndOpenPDF(context, pdfUrl); | |
| } else { | |
| askToOpenPDFThroughGoogleDrive( context, pdfUrl ); |
Image source pick for activity/fragment by using Gallery or Take photo
Add buildConfigFields from .properties file Create file in folder: D:\MyProject\app\properties\api\debug.properties
| ext { | |
| def propertiesFile = file('properties/version/version.properties') | |
| appVersionCode = 1; | |
| appVersionName = "1.0"; | |
| if (propertiesFile.canRead()) { | |
| Properties properties = new Properties() | |
| properties.load(new FileInputStream(propertiesFile)) | |
| appVersionCode = Integer.parseInt(properties['VERSION_CODE']).intValue(); | |
| appVersionName = String.valueOf(properties['VERSION_NAME']); | |
| } else { |
| public class EstadoActual extends Fragment { | |
| // this controls work perfect | |
| @InjectView(R.id.txtWork1) AutoCompleteTextView txtWork1; | |
| @InjectView(R.id.txtWork2) EditText txtWork2; | |
| // this controls are inside the viewstub, | |
| @InjectView(R.id.viewstub) ViewStub viewStub; | |
| MyDynamicView myDynamicView; |
| import android.content.Context; | |
| import android.graphics.Bitmap; | |
| import android.graphics.Canvas; | |
| import android.graphics.LinearGradient; | |
| import android.graphics.Paint; | |
| import android.graphics.drawable.GradientDrawable.Orientation; | |
| import android.support.annotation.ColorInt; | |
| import android.support.annotation.ColorRes; | |
| import android.support.annotation.FloatRange; | |
| import android.util.Log; |