Add buildConfigFields from .properties file Create file in folder: D:\MyProject\app\properties\api\debug.properties
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.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; |
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 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; |
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
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 { |
Image source pick for activity/fragment by using Gallery or Take photo
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 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 ); |
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 View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
super.onCreateView(inflater, container, savedInstanceState); | |
setHasOptionsMenu(true); | |
} | |
MenuItem menuItemCart; | |
@Override |
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
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); |
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
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 | |
} |
TextView:
- Max Length with ellipsize at end
- Clear focus from EditText after open a screen
OlderNewer