<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
	<channel>
		<title>Author at Infinum</title>
		<atom:link href="https://infinum.com/blog/author/petra-zavrski/feed/" rel="self" type="application/rss+xml" />
		<link></link>
		<description>Building digital products</description>
		<lastBuildDate>Fri, 17 Apr 2026 13:59:15 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>

					<item>
				<image>
					<url>8023https://infinum.com/uploads/2020/08/prepare-app-huawei-store-0.webp</url>
				</image>
				<title>How to Prepare an App for Huawei AppGallery</title>
				<link>https://infinum.com/blog/prepare-app-huawei-store/</link>
				<pubDate>Fri, 14 Aug 2020 15:00:00 +0000</pubDate>
				<dc:creator>Petra Završki</dc:creator>
				<guid isPermaLink="false">https://infinum.com/the-capsized-eight/prepare-app-huawei-store/</guid>
				<description>
					<![CDATA[<p>No uploading apps on AppGallery before you replace all Google services with the right Huawei alternative.</p>
<p>The post <a href="https://infinum.com/blog/prepare-app-huawei-store/">How to Prepare an App for Huawei AppGallery</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</description>
				<content:encoded>
					<![CDATA[<div
	class="wrapper"
	data-id="es-178"
	 data-animation-target='inner-items'>
		
			<div class="wrapper__inner">
			<div class="block-blog-content js-block-blog-content">
	
<div class="block-blog-content-sidebar" data-id="es-92">
	</div>

<div class="block-blog-content-main">
	
<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-95"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-93">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-94'
	>
	If you’ve been following the news related either to politics or the world of mobile development, you’ve probably heard about the issues in the collaboration between Google and Huawei.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-98"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-96">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-97'
	>
	In 2019, <a href="https://www.androidauthority.com/huawei-google-android-ban-988382/">the US government banned all US companies from cooperating with Huawei</a> – including Google, making any and all Google’s services or apps unavailable for preload or sideload on new Huawei devices.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-101"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-99">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-100'
	>
	Introducing Huawei AppGallery</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-104"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-102">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-103'
	>
	If you are an active Android mobile phone user, you depend on Google services more than you are probably aware – Gmail, YouTube, Maps, Drive, and many others.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-107"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-105">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-106'
	>
	Well, none of these apps are available on new Huawei smartphone models any longer. In fact, the whole concept of the Play Store is replaced with a Huawei alternative called AppGallery.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-110"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-108">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-109'
	>
	AppGallery Connect for easier development</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-113"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-111">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-112'
	>
	On top of the new AppGallery, there’s also AppGallery Connect. It’s an open platform that covers the app’s entire lifecycle, from innovation and development to distribution, operation, and analysis.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-116"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-114">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-115'
	>
	If we compare it to Google variants, it is basically a combination of Google API Console and Firebase Console, designed to simplify the development process by providing the ability to manage services, application settings, testing, and data analysis all in one place.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-119"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-117">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-118'
	>
	What does this mean for developers?</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-122"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-120">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-121'
	>
	Quite a number of apps are still not available on AppGallery, mainly because most applications developed for Android use some sort of Google service. Whether it is Maps, Firebase push notification system, Firebase Analytics, or Crashlytics.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-125"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-123">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-124'
	>
	This means that anyone who wants to upload their app on AppGallery won’t be able to do so until they replace all Google services with the right Huawei alternative.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-128"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-126">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-127'
	>
	Alternatively, you could try excluding any features that use Google services from the app before publishing it to AppGallery, but supporting Huawei alternatives is definitely better.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-131"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-129">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-130'
	>
	Customizing your app to use Huawei services</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-134"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-132">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-133'
	>
	If you are considering customizing your app to use Huawei services, first take a look at which ones are available. There is quite a long list of Huawei-supported services.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-137"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-135">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-136'
	>
	In the table below, you’ll find some of the most used Google services and their Huawei alternatives. The full list can be found on their <a href="https://developer.huawei.com/consumer/en/doc/landing/development">official website and in technical documentation</a>.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-140"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-138"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-stretch" data-id="es-139">
	<picture class="image__picture block-media__image-picture">
								
			<source
				srcset=https://infinum.com/uploads/2020/08/prepare-app-huawei-store-1-1400x560.webp				media='(max-width: 699px)'
				type=image/webp								height="560"
												width="1400"
				 />
												<img
					src="https://infinum.com/uploads/2020/08/prepare-app-huawei-store-1.webp"
					class="image__img block-media__image-img"
					alt=""
										height="960"
															width="2400"
										loading="lazy"
					 />
					</picture>

			<figcaption class="image__figcaption block-media__image-figcaption">
			Table of Huawei alternatives for Google services		</figcaption>
	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-143"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-141">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-142'
	>
	Individual service customization processes are not too demanding, but require certain changes in the architecture. More on the customization process and implementation tips in a separate blog post, coming soon!</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-146"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-144">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-145'
	>
	Customizing projects for AppGallery is in demand</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-149"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-147">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-148'
	>
	Lately, there has been a growing demand for customizing our projects and placing them on AppGallery.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-152"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-150">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-151'
	>
	We have already successfully adapted several projects to use Huawei services. If you are interested, check out <a href="https://infinum.com/work/a1-mobile/">one of the projects we customized for AppGallery</a>, which you can also find on GooglePlay.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-155"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-153">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-154'
	>
	When we first started the process of customization on one of our projects, it was quite challenging because the whole concept is still very fresh and is constantly changing. The positive thing is that all services and implementation guidelines are very well covered in the documentation.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-158"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-156">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-157'
	>
	Also, from our experience, the Huawei support team is quite helpful in case any implementation issues arise.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-161"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-159">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-160'
	>
	Is AppGallery here to stay?</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-164"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-162">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-163'
	>
	No one knows what the future holds, just like no one could have anticipated a situation like this to happen.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-167"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-165">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-166'
	>
	Huawei is working fast to improve its new system, and the requests to place apps on the AppGallery are becoming more and more common.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-170"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-168">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-169'
	>
	Quite many changes have been made since we started the Huawei services-customization process on one of our projects at the beginning of 2020. There are probably many more yet to be done before the whole system stabilizes.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-173"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-171">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-172'
	>
	Get your app ready for AppGallery</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-176"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-174">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-175'
	>
	Finally, if you own or are planning to make a mobile app, remember to count on one additional step in the development process going forward, at least if you want your app to be available in all markets.</p></div>	</div>
</div>
</div>		</div>
	</div><p>The post <a href="https://infinum.com/blog/prepare-app-huawei-store/">How to Prepare an App for Huawei AppGallery</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</content:encoded>
			</item>
					<item>
				<image>
					<url>8078https://infinum.com/uploads/2020/05/implementing-dark-theme-in-android-0.webp</url>
				</image>
				<title>Implementing Dark Theme in Android</title>
				<link>https://infinum.com/blog/implementing-dark-theme-in-android/</link>
				<pubDate>Thu, 07 May 2020 13:16:00 +0000</pubDate>
				<dc:creator>Petra Završki</dc:creator>
				<guid isPermaLink="false">https://infinum.com/the-capsized-eight/implementing-dark-theme-in-android/</guid>
				<description>
					<![CDATA[<p>As Android&#8217;s system-wide dark mode update affects all apps that support dark theme, here are two ways to implement dark theme in Android apps.</p>
<p>The post <a href="https://infinum.com/blog/implementing-dark-theme-in-android/">Implementing Dark Theme in Android</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</description>
				<content:encoded>
					<![CDATA[<div
	class="wrapper"
	data-id="es-284"
	 data-animation-target='inner-items'>
		
			<div class="wrapper__inner">
			<div class="block-blog-content js-block-blog-content">
	
<div class="block-blog-content-sidebar" data-id="es-179">
	</div>

<div class="block-blog-content-main">
	
<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-182"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-180">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-181'
	>
	In today’s connected world, millions of different applications are competing for the attention of users with new and innovative features every day. One of the crazy popular features in the last couple of years has definitely been <em>Dark theme</em>.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-185"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-183">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-184'
	>
	More than meets the eye</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-188"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-186">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-187'
	>
	Besides its sophisticated looks, dark theme offers much more. One of the biggest benefits is <strong>power reduction</strong>. When running in dark, you light up less pixels and the result is significant power usage reduction – <a href="https://www.youtube.com/watch?v=OCHEjeLC_UY&amp;t=66s">up to 60 percent</a>. It also makes your app easier to use in low-light environments and helps people sensitive to bright light get a better user experience.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-191"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-189">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-190'
	>
	Last year, Google introduced a new feature on Android 10 called <em>System theme change</em>. It enables switching between the light and dark theme in the system but also affects all apps which support the dark theme. That’s why developers are highly encouraged to start implementing dark theme in their apps.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-194"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-192">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-193'
	>
	Easy dark mode with Force dark</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-197"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-195">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-196'
	>
	With Android 10 came one more interesting feature called <em>Force dark</em>. It’s convenient for developers who don’t want to invest a lot of time into dark theme implementation. If you enable <em>Force dark</em> by setting <em>android:forceDarkAllowed=”true”</em> in your activity’s theme, it will analyze the views in runtime and automatically convert them to dark before they are drawn on the screen.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-199"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-kotlin github-light" data-language="kotlin" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">
</span></span><span class="line"><span class="token" style="color: #d73a49;">&lt;</span><span class="token">style name</span><span class="token" style="color: #d73a49;">=</span><span class="token">”Theme.AppCompat” parent</span><span class="token" style="color: #d73a49;">=</span><span class="token">”Theme.AppCompat.Light”</span><span class="token" style="color: #d73a49;">&gt;</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">..</span><span class="token">.
</span></span><span class="line"><span class="token" style="color: #d73a49;">&lt;</span><span class="token">item name</span><span class="token" style="color: #d73a49;">=</span><span class="token">”android</span><span class="token">:</span><span class="token" style="color: #6f42c1;">forceDarkAllowed</span><span class="token">”&gt;</span><span class="token" style="color: #005cc5;">true</span><span class="token" style="color: #d73a49;">&lt;</span><span class="token" style="color: #d73a49;">/</span><span class="token">item</span><span class="token" style="color: #d73a49;">&gt;</span><span class="token">
</span></span><span class="line"><span class="token">    </span><span class="token" style="color: #d73a49;">..</span><span class="token">.
</span></span><span class="line"><span class="token" style="color: #d73a49;">&lt;</span><span class="token" style="color: #d73a49;">/</span><span class="token">style</span><span class="token" style="color: #d73a49;">&gt;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-202"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-200">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-201'
	>
	In most cases, if layouts are not too complicated, it does a solid job.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-205"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-203"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-auto" data-id="es-204">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2020/05/implementing-dark-theme-in-android-1.webp"
					class="image__img block-media__image-img"
					alt=""
										height="752"
															width="416"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-208"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-206"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-auto" data-id="es-207">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2020/05/implementing-dark-theme-in-android-2.webp"
					class="image__img block-media__image-img"
					alt=""
										height="759"
															width="416"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-211"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-209">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-210'
	>
	That being said, some slightly more complicated layouts can end up looking funny, so make sure to test your app well before settling with <em>Force dark</em>.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-214"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-212"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-auto" data-id="es-213">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2020/05/implementing-dark-theme-in-android-3.webp"
					class="image__img block-media__image-img"
					alt=""
										height="757"
															width="416"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-217"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-media">
	<div	class="media block-media__media media__border--none media__align--center-center"
	data-id="es-215"
	 data-media-type='image'>

	<figure class="image block-media__image-figure image--size-auto" data-id="es-216">
	<picture class="image__picture block-media__image-picture">
												<img
					src="https://infinum.com/uploads/2020/05/implementing-dark-theme-in-android-4.webp"
					class="image__img block-media__image-img"
					alt=""
										height="757"
															width="416"
										loading="lazy"
					 />
					</picture>

	</figure></div></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-220"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-218">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-219'
	>
	Another disadvantage of this approach is the lack of control over the app’s appearance in the dark version. That’s why <em>custom implementation</em> is highly recommended.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-223"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-221">
	<h3	class='typography typography--size-36-text js-typography block-heading__heading'
	data-id='es-222'
	>
	Laying the groundwork is half the success</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-226"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-224">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-225'
	>
	Before digging in the dark theme implementation you need to ensure <em>using themes and styles when defining your layouts</em>. Removing all hard coded colors or direct referencing to color resources out of your app and instead using theme attributes will make the process of dark theme implementation faster and much easier.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-229"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-227">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-228'
	>
	The biggest challenge is adjusting your custom views. <a href="https://infinum.com/blog/how-to-support-themes-in-custom-views-for-android-apps/">This article</a> describes well how to achieve this without much difficulty. Once you’ve done spring cleaning, you are ready for implementation.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-232"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-230">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-231'
	>
	Custom dark theme implementation</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-235"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-233">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-234'
	>
	First step is to make your app’s theme inherit one of the <em>DayNight</em> variants:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-237"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-kotlin github-light" data-language="kotlin" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">
</span></span><span class="line"><span class="token" style="color: #d73a49;">&lt;</span><span class="token">style name</span><span class="token" style="color: #d73a49;">=</span><span class="token">”AppTheme” parent</span><span class="token" style="color: #d73a49;">=</span><span class="token">”Theme.AppCompat.DayNight”</span><span class="token" style="color: #d73a49;">&gt;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-240"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-238">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-239'
	>
	Or if you prefer <em>MaterialComponents theming</em> (recommended option):</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-242"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-kotlin github-light" data-language="kotlin" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">
</span></span><span class="line"><span class="token" style="color: #d73a49;">&lt;</span><span class="token">style name</span><span class="token" style="color: #d73a49;">=</span><span class="token">”AppTheme” parent</span><span class="token" style="color: #d73a49;">=</span><span class="token">”Theme.MaterialComponents.DayNight”</span><span class="token" style="color: #d73a49;">&gt;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-245"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-243">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-244'
	>
	What really happens then is it enables the -night resource qualifier when in dark theme.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-248"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-246">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-247'
	>
	values/themes.xml</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-250"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-kotlin github-light" data-language="kotlin" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">
</span></span><span class="line"><span class="token" style="color: #d73a49;">&lt;</span><span class="token">style name</span><span class="token" style="color: #d73a49;">=</span><span class="token">”Theme.AppCompat.DayNight” parent</span><span class="token" style="color: #d73a49;">=</span><span class="token">”Theme.AppCompat.Light”</span><span class="token" style="color: #d73a49;">&gt;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-253"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-251">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-252'
	>
	values-night/themes.xml</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-255"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-code">
	<pre class="phiki language-kotlin github-light" data-language="kotlin" style="background-color: #fff;color: #24292e;"><code><span class="line"><span class="token">
</span></span><span class="line"><span class="token" style="color: #d73a49;">&lt;</span><span class="token">style name</span><span class="token" style="color: #d73a49;">=</span><span class="token">”Theme.AppCompat.DayNight” parent</span><span class="token" style="color: #d73a49;">=</span><span class="token">”Theme.AppCompat”</span><span class="token" style="color: #d73a49;">&gt;</span><span class="token">
</span></span><span class="line"><span class="token">
</span></span></code></pre></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-258"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-256">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-257'
	>
	First theme is being used when your app is running in <em>Light mode</em> and the second one in the <em>Dark mode</em>. That’s how you need to define your light and dark variants of BaseApp theme.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-261"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-259">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-260'
	>
	Once you have properly defined all attributes in your theme that are relevant for defining your App’s looks, all you have to do is modify those values in the dark version of your theme. You can define all required values in night variant of resources such as <em>drawables-night, styles-night, colors-night</em> etc.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-264"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-262">
	<h3	class='typography typography--size-36-text js-typography block-heading__heading'
	data-id='es-263'
	>
	Change themes in app</h3></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-267"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-265">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-266'
	>
	The idea for theme changing is to let the users choose. There are 4 recommended theme options and compatible <em>AppCompat.DayNight</em> modes:</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-270"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="lists" data-id="es-268">
	<ul	class='typography typography--size-16-text-roman js-typography lists__typography'
	data-id='es-269'
	>
	<li>Light &#8211; <em>MODE_NIGHT_NO</em></li><li>Dark &#8211; <em>MODE_NIGHT_YES</em></li><li>Set by Battery Saver (for Android 9 and earlier) &#8211; <em>MODE_NIGHT_AUTO_BATTERY</em></li><li>Set by System default (for Android 10) &#8211; <em>MODE_NIGHT_FOLLOW_SYSTEM</em></li></ul></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-273"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-271">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-272'
	>
	The last two are recommended options depending on the Android version of your App. To switch between day and night theme call <em>AppCompatDelegate.setDefaultNightMode(int mode)</em> with one of the modes.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-276"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-274">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-275'
	>
	Starting with AppCompat v1.1.0, calling this method automatically recreates all started activities and you can see instant theme change. The only problem is that change is not persisted once the process is dead. You have to remember and retrieve user selection and call the appropriate method every time your app process is started.</p></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-279"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-heading" data-id="es-277">
	<h2	class='typography typography--size-52-default js-typography block-heading__heading'
	data-id='es-278'
	>
	Let there be dark or light – it’s up to you</h2></div>	</div>

<div
	class="wrapper wrapper__use-simple--true"
	data-id="es-282"
	 data-animation='slideFade' data-animation-target='inner-items'>
		
			<div class="block-paragraph" data-id="es-280">
	<p	class='typography typography--size-16-text-roman js-typography block-paragraph__paragraph'
	data-id='es-281'
	>
	Even though <em>DayNight</em> has been available for a while now, the improvement over the course of the last year has been the most significant, the result of which is an uncomplicated procedure of dark theming which will, once implemented, enrich any app with an attractive and useful feature that will light your users’ day up.</p></div>	</div>
</div>
</div>		</div>
	</div><p>The post <a href="https://infinum.com/blog/implementing-dark-theme-in-android/">Implementing Dark Theme in Android</a> appeared first on <a href="https://infinum.com">Infinum</a>.</p>
]]>
				</content:encoded>
			</item>
		
	</channel>
</rss>