Appearing two splash screen - react-native

I configured the splash screen and two are showing.
How do I remove it first?
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#color/primary" />
<item
android:drawable="#mipmap/logo"
android:height="300dp"
android:width="300dp"
android:gravity="center"
/>
</layer-list>
This is my splash screen and before she appears another one with the ic_launcher_round.

Related

Kotlin: How to change background color of the toggle button?

I hope to change the background of the Toggle Button.
There would be two ways, in xml and in code, I think..
I have made using xml like this, successfuly;
<ToggleButton
android:id="#+id/downloadButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="Download"
android:textOn="Downloaded"
android:background="#drawable/toggle_bg_sector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
toggle_bg_sector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="#drawable/toggle_download"
android:state_checked="false"/>
<item
android:drawable="#drawable/toggle_downloaded"
android:state_checked="true"/>
</selector>
toggle_download.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#color/blue" />
</shape>
toggle_downloaded.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#color/gray" />
</shape>
It works very well..
However, I want to know to make this Programmatically.
I made this inside of the onCreate.
downloadButton.setOnCheckedChangeListener { _: CompoundButton?, isChecked ->
if (isChecked)
downloadButton.setBackground(R.drawable.toggle_download)
else
downloadButton.setBackground(R.drawable.toggle_downloaded)
}
However, I got and error message on the R.drawable.toggle_download.
Can someone explain it?
You also change the color in MainActivity like This
downloadButton.setOnCheckedChangeListener { _: CompoundButton?, isChecked ->
if (isChecked)
downloadButton.setBackground(R.drawable.red)
else
downloadButton.setBackground(R.drawable.blue)
}
In this way you can easily change the background color of toggle button

Android RatingBar below Lollipop renders incorrectly

I'm using my custom rating bar. The top image with 5 stars is on Lollipop where my ratingbar works fine. However, below Lollipop (Kitat, JellyBean, ICS) versions the rating bar is goofed up (check second image with a single star)
What can be the problem? I tried all possible methods, changing theme, managing height width...nothing seems to work :(
This is the style
<style name="customRatingBar" parent="#android:style/Widget.RatingBar">
<item name="android:progressDrawable">#drawable/rating_custom_bar</item>
</style>
This is the rating bar xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="#+android:id/background"
android:drawable="#drawable/star_blank"/>
<item
android:id="#+android:id/secondaryProgress"
android:drawable="#drawable/star_blank"/>
<item
android:id="#+android:id/progress"
android:drawable="#drawable/star_filled"/>
</layer-list>
This is star blank
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/rating_empty" android:state_pressed="true" android:state_window_focused="true"/>
<item android:drawable="#drawable/rating_empty" android:state_focused="true" android:state_window_focused="true"/>
<item android:drawable="#drawable/rating_empty" android:state_selected="true" android:state_window_focused="true"/>
<item android:drawable="#drawable/rating_empty"/>
</selector>
This is star filled
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/rating_full" android:state_pressed="true" android:state_window_focused="true"/>
<item android:drawable="#drawable/rating_full" android:state_focused="true" android:state_window_focused="true"/>
<item android:drawable="#drawable/rating_full" android:state_selected="true" android:state_window_focused="true"/>
<item android:drawable="#drawable/rating_full"/>
</selector>
I have the same problem and spend a lot of time in it, tried setting all parameters at the ratingBar but none work, but there was something weird. I was working with a friend in a project and he compiles the exact same code as I and doesn't have this issue, so I change the IDE to his and all starts working.
I was using "Android Developer Tools", the eclipse you used to download at https://developer.android.com/training/index.html which is an eclipse with the ADT already embedded.
I change to Java EE and download ADT following this instructions http://developer.android.com/sdk/installing/installing-adt.html
I hope this helps you with your problem.
Has been a while but never hurts to answer. Here is my 3 step solution regardless of SDK version.
1- Add this as your RatingBar in your xml layout:
<RatingBar
android:id="#+id/new_ratingbar"
android:progressDrawable="#drawable/custom_drawable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:stepSize="0.5"/>
If needed, you can give the RatingBar minHeight and maxHeight or add other attributes as required.
2- Here is the drawable you would refer the above progressDrawable to:
custom_drawable.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="#android:id/background"
android:drawable="#drawable/rating_bar_empty" /> <!--this is your .png file-->
<item
android:id="#android:id/secondaryProgress"
android:drawable="#drawable/rating_bar_fill" /> <!--this is your .png file-->
<item
android:id="#android:id/progress"
android:drawable="#drawable/rating_bar_fill" /> <!--this is your .png file-->
</layer-list>
3- The last thing is to provide the .png files in your various drawable folders.

Disable the default actionbar on titanium sdk 3.5.0GA

I updated my Titanium sdk to 3.5.0GA, but there exits a default action bar on every window on Android.
Can anyone please tell me how to permanently disable this default action bar?
Thanks in advance.
Define the settings for your custom theme, for example, your theme at /platform/android/res/values/customtheme.xml like
< ?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
Then, activate this theme on your tiapp.xml:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application android:theme="#style/Theme.NoActionBar"/>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19"/>
</manifest>
</android>
for more see : Link

Android L "delightful" drawable transformations

Does Google allow for icon transitions such as these to be created by the developer? Or is it the developers responsibility to create such "delightful" transitions? I'd really like to implement these in my app.
Specifically icons like this
You can create an animated icon using AnimatedDrawable and bitmap-based frames. On L, you can use AnimatedStateListDrawable to create stateful animations (such as the check box animation).
Here is an AnimatedDrawable example (actually this is the implementation for the check box on L preview) using 15ms-long frames that can be started and stopped from code:
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:duration="15" android:drawable="#drawable/my_icon_frame_000" />
...additional frames...
</animation-list>
And here is an AnimatedStateListDrawable using AnimatedDrawable transitions to implement a check box animation that starts and stops automatically based on View state:
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:state_checked="true">
<bitmap android:src="#drawable/btn_check_to_on_mtrl_015" android:tint="?attr/colorControlActivated" android:alpha="?attr/disabledAlpha" />
</item>
<item android:state_enabled="false">
<bitmap android:src="#drawable/btn_check_to_on_mtrl_000" android:tint="?attr/colorControlNormal" android:alpha="?attr/disabledAlpha" />
</item>
<item android:state_checked="true" android:id="#+id/on">
<bitmap android:src="#drawable/btn_check_to_on_mtrl_015" android:tint="?attr/colorControlActivated" />
</item>
<item android:id="#+id/off">
<bitmap android:src="#drawable/btn_check_to_on_mtrl_000" android:tint="?attr/colorControlNormal" />
</item>
<transition android:fromId="#+id/off" android:toId="#+id/on">
<animation-list>
<item android:duration="15">
<bitmap android:src="#drawable/btn_check_to_on_mtrl_000" android:tint="?attr/colorControlNormal" />
</item>
...additional frames...
</animation-list>
</transition>
<transition android:fromId="#+id/on" android:toId="#+id/off">
<animation-list>
<item android:duration="15">
<bitmap android:src="#drawable/btn_check_to_off_mtrl_000" android:tint="?attr/colorControlActivated" />
</item>
...additional frames...
</animation-list>
</transition>
</animated-selector>

I want to set an animated image in my application

I want to set an animated image in my application.i use an animation-list to show it frame by frame but it's not working!!
please help me!!
here is Java code
_imagView=(ImageView)findViewById(R.id.imageView1);
_imagView.setBackgroundResource(R.drawable.anim);
AnimationDrawable anim1 = (AnimationDrawable) _imagView.getBackground();
anim1.start();
and here is anim.xml
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="#drawable/animationchoking0" android:duration="500" />
<item android:drawable="#drawable/animationchoking1" android:duration="500" />
<item android:drawable="#drawable/animationchoking2" android:duration="500" />
<item android:drawable="#drawable/animationchoking3" android:duration="500" />
<item android:drawable="#drawable/animationchoking4" android:duration="500" />
<item android:drawable="#drawable/animationchoking5" android:duration="500" />
<item android:drawable="#drawable/animationchoking6" android:duration="500" />
<item android:drawable="#drawable/animationchoking7" android:duration="500" />
<item android:drawable="#drawable/animationchoking8" android:duration="500" />
</animation-list>
According to the Development guide,you should not call start method directly in onCreate() of your Activity(Drawable Animation at the bottom).Try this:
_imagView.post(new Runnable() {
#Override
public void run() {
// TODO Auto-generated method stub
anim1.start();
}
});