LinearGradient not going transparent as end color - Java for Android App Development

I've set my LinearGradient like this
Code:
TextPaint paintText = new TextPaint(Paint.ANTI_ALIAS_FLAG);
paintText.setColor(Color.WHITE);
paintText.setTextSize(size);
paintText.setStyle(Paint.Style.FILL_AND_STROKE);
paintText.setShadowLayer(3f, 3f, 3f, Color.BLACK);
int pL = bitmap.getWidth() / 100;
int pT = bitmap.getHeight() / 100;
StaticLayout mTextLayout = new StaticLayout(
gagTitle,
paintText,
newCanvas.getWidth(),
Layout.Alignment.ALIGN_NORMAL,
1.0f,
0.0f,
false);
int dummyHeight = mTextLayout.getHeight();
Shader shader = new LinearGradient(0, 0, 0, (dummyHeight * 2), Color.BLACK, Color.TRANSPARENT, Shader.TileMode.MIRROR);
Paint paint = new Paint();
paint.setShader(shader);
newCanvas.drawRect(new RectF(0, 0, bitmap.getWidth(), dummyHeight), paint);
I don't know why but at the end of generated gradient it's less brighter black other than being transparent.
Here is the result
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Best Regards

It's normal, change this line with this:
Code:
Shader shader = new LinearGradient(0, 0, 0, (dummyHeight), Color.BLACK, Color.TRANSPARENT, Shader.TileMode.MIRROR);

Related

[LIB] PDF417 barcode generator

I've been looking for a way to generate this one kind of barcode that Starbucks cards use for mobile pay [shameless plug: click here for app] and I couldn't find any libraries that could do it on Android.
So I made one! Classes, Javadoc, and source are included in the attached jar. You may need to rename it from .zip to .jar, depending on what setup you use. (Eclipse seems to be cool with .zip)
PDF417 library for Android is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at sourceforge.net. Contact me for permissions beyond the scope of this license.
Example:
Code:
import com.exavore.PDF417.PDF417;
ImageView view = (ImageView) findViewById(R.id.ImageViewGoesHere);
String source = "7777012345678910";
PDF417 barcode = new PDF417(source);
Bitmap someBitmap = barcode.encode();
view.setImageBitmap(someBitmap);
PDF417 barcodes look like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Thanks! Saved me a lot of time

[Tutorials] Add author information at about the phone

First you have to know how to decompile
well,then
Let Tutorials Begin!
1.decompile settings.apk
2.goto res/xml open device_info_settings.xml
3.Find the last line </ PreferenceScreen>,
Add this line in the above
<Preference android:title="@string/123" android:key="123" android:summary="@string/456" style="\?androidreferenceInformationStyle" />
Click to expand...
Click to collapse
Attention to the alignment
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
4.Then the values ​​/ strings.xml find the last line </ resources>
Also note that the alignment
added above the <string name="123"> ROM Developer </ string>
<string name="456"> your name </ string>
(above 456 behind the is the author *information)
Then you can compile it.
well done
A little preview
GOOD I Chinese

[Library] ContextMenu - floating menu like the new Text Selection in Android 6.0

Description
ContextMenu is a floating menu which show up when user click on a view that it is clipped to. Just like the new Text Selection in Android 6.0.
Check it on Github: ContextMenu
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation
Add this to your app Gradle:
Code:
dependencies {
compile 'com.rstudio.widget:contextmenu:0.1'
}
Declare a new ContextMenu:
Code:
ContextMenu menu = new ContextMenu.Builder(context)
.setContextMenuView(R.layout.context_menu)
.build();
Clip ContextMenu to your view:
Code:
menu.clipToView(desView);
Discussion
For more information and issues, please check this Github repo:
ContextMenu

[Library] Lemniscate Progress View

Hi Xda, I've been working on this library for past couple of weeks. The library is a collection of progress views based on mathematical curves. Please try it, fork it, and contribute to it.
Github project page: https://github.com/vlad1m1r990/Lemniscate
Apache License 2.0.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Setup
Add to your module's build.gradle:
Code:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
and to your app build.gradle:
Code:
dependencies {
compile 'com.github.vlad1m1r990:Lemniscate:1.0.2'
}
Usage:
Code:
<com.vlad1m1r.lemniscate.BernoullisProgressView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:duration="1000"
app:hasHole="false"
app:lineColor="@color/colorPrimary"
app:lineLength="0.6"
app:lineLengthChangeable="true"
app:maxLineLength="0.8"
app:minLineLength="0.4"
app:sizeMultiplier="1"
app:strokeWidth="5dp"/>
More about library can be found on GitHub page.

RE: identify this headunit please ANDROID F9212B_00020_V001

Guys ; is this enough to ID this unit please, thank you. Happy 2022
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I figured i answer my self hhhh
alps 8227L_demo ; CPU, 4 cores; ARMv7 Processor rev 3 (v7l); Max: 1118,0 MHz; Min: 598,0 MHz ; Display, 1024 x 600; DPI: 240; Evaluated Size: 4,9" ; Touch screen ...
In case somebody looking to ID this biatch

Categories

Resources