How to animate default splash screen in nativescript angular - nativescript-angular

I was wondering how to animate the default splash screen which comes with nativescript, possibly the logo?
Is there a way of adding some css animation to the splash_screen.xml file found in the drawable folder? Thanks

You can use nativescript-splashscreen plugin to add animation in your splash screen. You need to update your AndroidManifest.xml e.g.
<activity
android:name="com.tns.NativeScriptActivity"
android:label="#string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize">
</activity>
<activity
android:name="co.fitcom.SplashScreen" android:noHistory="true">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>

Related

How to display Situm (indoor positioning) maps in Android Studio?

Suppose that the Situm API key is already implemented.
I replaced the API key with ## in the code to not show the key for security.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.bkcnavigator" >
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"`enter code here`
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.BKCNavigator"
tools:targetApi="31" >
<activity
android:name=".MainActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Google play services version -->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<!-- GMaps api key -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="##" />
<!-- Situm SDK credentials -->
<meta-data
android:name="es.situm.sdk.API_USER"
android:value="dr-montaa#hotmail.com"/>
<meta-data
android:name="es.situm.sdk.API_KEY"
android:value="##"/>
</application>
</manifest>
The Output:
It shows a Google map and a search bar (Not working yet)at the top.
I want the output to be like this:
It shows a google map with the image of the floor of the building.

Mainactivity statusbar color is white, can't change it

I've tried everything and i've not been able to the change the color of the statusbar. I have multiple activities that uses the same Style theme where I have declared the statusbar color as blue and it works. Mainactivity should also be using the same theme but its not. I've also tried changing the color by code which has not given any results.
Android manifest:
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#drawable/logowbg"
android:label="#string/app_name"
android:roundIcon="#drawable/logowbg"
android:supportsRtl="true"
android:theme="#style/AppTheme.MainActCustom">
<activity android:name=".SplashScreen" android:theme="#style/Apptheme.CustomSplash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ShowNewsDetailed" />
<activity android:name=".MainActivity" />
<activity
android:name=".OptionsPop"
android:theme="#style/Apptheme.CustomPopupStyle" />
<activity android:name=".Settings" />
</application>
MainActCustom:
<style name="AppTheme.MainActCustom" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:background">#color/mainBGColor</item>
<item name="android:statusBarColor">#color/mainBGColor</item>
<item name="android:textColorSecondary">#color/mainTextBGColor</item>
<item name="colorPrimary">#color/mainBGColor</item>
</style>
Check if there ir2 styles files in your project. If there is, one is named "styles (v21)".
Check the line
<item name="android:statusBarColor">#android:color/transparent</item>

Android Studio Not Applying My Design Changes

I'm trying to change the theme of some activities by removing the action bar or changing the title of it. At first i was doing it using the AppTheme option in the design tab. However, after searching online i knew that i was doing it the wrong way, so i proceeded to the AndroidManifest file to do my changes manually. Unfortunately, it's not working either. Here's the code of my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.wonderheart">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity"
android:label="Sign Up"/>
<activity
android:name=".Login"
android:label="Log In"/>
<activity android:name=".drawable.welcome">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".UserProfile"
android:theme="#style/AppTheme.NoActionBar"/>
<activity android:name=".HomePage" >
</activity>
</application>
</manifest>
Here are some of my activities that I'm trying to change:
Action Bar Title Changed Successfully
Action Bar Title Didn't Change
I'm using Android Studio 3.0 Preview and Kotlin. I hope you can help because i can't progress on my work without fixing this design issue!
You can fix problem two way.
1. Use common one theme for all activities and use code for hiding and showing action bar in onCreate method
// Set up the toolbar
val toolbar = findViewById(R.id.toolbar) as Toolbar
setSupportActionBar(toolbar)
var actionBar = supportActionBar
//For hiding android actionbar
actionBar.hide();
//For showing android actionbar
//actionBar.show();
Use custom style for activity where you don’t want to show action bar in example below I did it for application level but you can use it your way with your any other activities
style.xml
<resources>
<style name = "AppTheme" parent = "android:Theme.Holo.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
<style name = "NoActionBar" parent = "#android:style/Theme.Holo.Light">
<item name = "android:windowActionBar">false</item>
<item name = "android:windowNoTitle">true</item>
</style>
</resources>
AndroidManifest.xml
<application
android:allowBackup = "true"
android:icon = "#drawable/ic_launcher"
android:label = "#string/app_name"
android:theme = "#style/NoActionBar" <!--This is the important line-->
>
<activity

I want gradle to build only single class instead of the whole project

In Android Studio project I have a separate class where I experiment with java code. The class has method public static void main(String[] args){}
Right click on this class in project tree -> Run (Ctrl+Shift+F10)
And I noticed that gradle starts building the whole project. And it takes certain time but I want it to build and run only this one class. So it is as fast as possible.
How can I achieve this?
You can try modifying your AndroidManifest file to run only the class you want as a main-launcher class:
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#drawable/my_icon"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:icon,android:theme">
<activity
android:name=".RUN_YOUR_ACTIVITY"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

How do you get the hardware back button on VideoCastControllerActivity to work?

Once my app starts playing and VideoCastControllerActivity shows up, the hardware back button won't take it back to my activity. The actionbar back button works just fine. I don't see any errors on the logs or anything and looking at the VideoCastControllerActivity I didn't see anything obvious trying to capture the back button behaviour or anything. To start it I am calling startCastControllerActivity.
Here is the chunk of my manifest declaring it:
<activity
android:name="com.google.sample.castcompanionlibrary.cast.player.VideoCastControllerActivity"
android:label="#string/app_name"
android:launchMode="singleTask"
android:parentActivityName="com.mypackage.myactivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.mypackage.myactivity" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
Thanks.
The CastCompanionLibrary doesn't try to capture the back button at all, so it should work just fine. Please try the CastVideos-andrid (which uses that library) to confirm that.

Resources