I'm tyring to use a badget with Materials but I have several custom styles and when I use it, my custom button's style dissapear
I know that it works If I replace in my manifest
android:theme="#style/Theme.AppCompat.NoActionBar"
with
android:theme="#style/Theme.MaterialComponents.DayNight.NoActionBar"
Here is my full manifest
<application
android:allowBackup="true"
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.AppCompat.NoActionBar"
android:windowSoftInputMode="adjustPan"
tools:targetApi="31">
But I have a custom xml to modify my buttons which I attach using the backgroudn property of buttons and when I change the manifest I lose my effects
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:type="radial"
android:centerX="50%"
android:centerY="50%"
android:startColor="#6859C1"
android:endColor="#34278C"
android:gradientRadius="100%"
/>
<stroke android:width="1dp"
android:color="#FFFFFF"/>
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"/>
<corners android:radius="30px"/>
</shape>
What am I doing wrongly?
Thanks in advance!
Related
I designed an Android app with Jetpack Compose. I did not change anything in themes.xml, though my app does not skip to the starting destination of my app. A screen appears and does not go away unless i touched screen. When i change the parent line in themes.xml, android:Theme.Material.NoActionBar to android:Theme.Material.NoActionBar.FullScreen then app works fine but I don't want to make it fullscreen. Is it possible that is a bug ?
<style
name="Theme.TradeJournal" parent="android:Theme.Material.NoActionBar"> //👈 this line
<item name="android:statusBarColor">#color/purple_200</item>
</style>
themes.xml :
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name="Theme.TradeJournal" parent="android:Theme.Material.NoActionBar">
<item name="android:statusBarColor">#color/purple_200</item>
</style>
</resources>
AndroidManifests :
<?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.sevban.tradejournal">
<uses-permission android:name="android.permission.INTERNET"> </uses-permission>
<application
android:name=".TradeJournalApplication"
android:allowBackup="true"
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.TradeJournal"
tools:targetApi="31">
<activity
android:name=".view.MainActivity"
android:exported="true"
android:theme="#style/Theme.TradeJournal">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks in advance.
Maybe you should define a parent theme and create NoActionBar as it child as shown below:
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryVariant">#color/colorPrimary</item>
<item name="colorOnPrimary">#color/white</item>
<item name="colorAccent">#color/colorPrimary</item>
<!-- Secondary brand color. -->
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:statusBarColor">#color/white</item>
<item name="android:fontFamily">#font/calibri_regular</item>
<item name="android:windowBackground">#color/white</item>
</style>
<style name="Theme.AppSplash" parent="Theme.SplashScreen">
<item name="android:windowFullscreen">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="windowSplashScreenBackground">#color/white</item>
<item name="windowSplashScreenAnimatedIcon">#drawable/app_logo</item>
<item name="windowSplashScreenAnimationDuration">300</item>
<item name="postSplashScreenTheme">#style/AppTheme.NoActionBar</item>
</style>
And in Manifest:
<application
android:name="****"
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.NoActionBar">
<activity
android:name=".ui.main.MainActivity"
android:exported="true"
android:theme="#style/Theme.AppSplash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Main Activity:
#AndroidEntryPoint
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val splashScreen = installSplashScreen()
splashScreen.setKeepOnScreenCondition { true }
setContent {
Content()
}
}
}
It was a general issue that is debating in issuetracker.
https://issuetracker.google.com/issues/227926002
Especially Xiaomi devices undergo this problem.
I have published a react native application to google play store for Android Mobile and android tv.
App successfully published for Android Mobile but rejected for Android Tv.
For tv, I have received notification for:
Missing DPad functionality
Your app requires user interaction for menus or app navigation. Please make sure that all menus and app navigation are fully functional using a DPad. Please refer to our DPAD Control and Hardware Declaration documentation.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rsdtech">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name= "android.permission.ACCESS_WIFI_STATE" />
<uses-feature android:name="android.software.leanback"
android:required="false" />
<uses-feature android:name="android.hardware.touchscreen"
android:required="false" />
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:banner="#drawable/tv_banner"
android:allowBackup="false"
android:theme="#style/AppTheme"
android:usesCleartextTraffic="true"
>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
How to add DPad functionality in my project. App have functionality focus and navigation on android tv but Even then got rejected from google play console.
If you need any more info add , just let me know.
You need to use the leanbackLauncher.
I've gotten it working but am away from computer so I'll update this once I can check out how I did it, but I'm 99% sure if you Google leanbackLauncher it will lead you in the right direction
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
I opened only untitled project in intellij idea and wrote getActionBar() there is:
java: cannot find symbol
symbol: method getActionBar()
location: class com.example.untitled.MyActivity
and Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.untitled"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7"/>
<application android:label="#string/app_name">
<activity android:name="MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
what is reason of this?
I don't know why Wen run the android app i'm developing, when i want to show maps i obtain an acivity blank with only zoom buttons and the log is:
Failed to find provider info for com.google.android.gsf.gservices
This is the activity that show the map
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
This is the file manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="md.clt.android"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="md.client.android.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="md.client.android.permission.MAPS_RECEIVE" />
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Allows the API to access Google web-based services -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- Allows the API to cache map tile data in the device's external storage area -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<!-- Google Maps Android API requires OpenGL ES version 2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="My_apy_key" />
<activity
android:name="md.clt.android.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="md.clt.android.PoiMap"
android:label="#string/title_activity_poi_map" >
</activity>
<activity
android:name="md.clt.android.PoiListActivity"
android:label="#string/title_activity_poi_list" >
</activity>
</application>
</manifest>
What it means?