How to Animated Recycler View?

Animated Recycler View is a library that allows you to animate a recycler view in your project like Google does it in its Google Play Store. Only the first visible items are animated there and you will see no animation when the recycler view scrolls up.

Animated Recycler View - Transition Page Recycler with layout animations
Animated Recycler View – Transition Page Recycler with layout animations

Reasons to use it

This library solves several problems:

  1. It works stably fast and without jerks.
  2. It doesn’t need to utilize the adapter to animate items when they appear for the first time.

Recommended article : Is LastAdapter ending RecyclerView adapter?

Why Animated Recycler View is special for you?

While working on a project, most of time we need animation similar to the one used in the Google Play Store but didn’t find any appropriate library on Internet/ Github/ StackOverflow that could help us with this task.

Source: How to Transition Page Recycler using Animated Recycler View? 

Advertisements

Analyze APK sizes – Best Programming language for Android

There are so many ways to make mobile apps ranging from direct platform specific development (using Java and Kotlin for Android, and ObjC and Swift for iOS), there’s React Native from Facebook, Electrode Native from Walmart, the Ionic framework, Unity for certain types of apps, and the flutter.io framework which was just released by Google.

Ever wondered how these libraries and frameworks affect the size of your app? Let’s analyze some apk files for apps written in some of these ways. The apps are very basic, containing just a title at the top and a text at the center of the screen.

Which Language is Good for Android by Analyze APK sizes?
Which Language is Good for Android by Analyze APK sizes?

This will show, for a bare minimum app what these frameworks need to package along with the apk for it to be able to run.

  • For this test I created four different versions of the app, one in each of JavaKotlinReact Nativeand Flutter. (Android API 27)
  • The apks were then published for release type using Android Studio for Java and Kotlin and using the cli for React Native and Flutter.
  • Default proguard configuration was used.
  • The apks were analyzed using the Analyze APK feature in Android Studio.

Source: Which Language is Good for Android by Analyze APK sizes?

Kotlin can overcome Java issues?

This article looks at many categories of Java defects that Kotlin prevents in addition to null safety. Kotlin showed a surprising impact on productivity.

This article looks at many categories of Java defects that Kotlin prevents in addition to null safety. My first article (5 cool thing about Kotlin) provided a brief introduction to Kotlin and showed a surprising impact on productivity.

It’s important to realize the difference in value in fixing a defect in one class versus preventing an entire category of Java defects from occurring in any class.

What we see today:

Source: How Kotlin remove Java defects? 

Tricks : Multiply by 9 without pen and paper

Now you’re ready to multiply any number with 9 in 3 sec.

28 X 9 = ?

From Step 2, we’ve to subtract 28 with 3 :

28 – 3 = 25(this is your first part of your answer)

Now from Step 1, we’ve to multiply the unit place of 28 by 9 i.e. 8 X 9.

8 X 9 = 72 and we’ll take only unit place of answer i.e. 2

And, finally merge both step and your answer is

28 X 9 = 252

Let’s take one more example : 57 X 9 =?

57 – 6 = 51

7 X 9 = 63

57 X 9 = 513

 

Source: Magic Multiply by 9 Trick – Mind Calculation in 3 sec 

CRUD Tutorial of Spring Boot with Kotlin and AngularJS

Today we’re going to learn CRUD example using Spring boot, Kotlin and AngularJS with WebJar. For this tutorial, nothing is assumed except some basic Java experience.

Spring Boot + Kotlin + AngularJS + WebJar CRUD Example

We’ll show you how simple it is to create compliant and flexible REST services using the incredible frameworks Spring Boot and Kotlin. We’ll go through the how and why of …

Source: Spring Boot + Kotlin + AngularJS + WebJar CRUD Example

Difference MVC v/s MVP v/s MVVM

Today, the MVC pattern is used by well-known frameworks such as Ruby on Rails, Apple iOS Development, ASP.NET MVC, etc. While MVP is mostly used for ASP.NET Web Forms applications and MVVM is used by WPF, Caliburn, Silverlight, nRoute, and more. Which development pattern are you currently using in your software projects? Let us know in the comments below.

Source: Comparison between MVC, MVP and MVVM in details

How to Add Popup Menu in Android?

Android Popup menu is really a good way to make your Android application more elegant and create a great UI.  And we already discuss some menu library for Android application like ;

Now let’s focus on PowerMenu Android library which is a library that let you implement Android popup menu so easily. Without going much more start with implementation.

Demo

Android Popup Menu PowerMenu Example
Android Popup Menu PowerMenu Example

This is a basic example on a screenshot. You can build PowerMenu(Android Popup Menu) using Builder.

PowerMenu powerMenu = new PowerMenu.Builder(context)
.addItemList(list) // list has "Novel", "Poerty", "Art"
.addItem(new PowerMenuItem("Journals", false))
.addItem(new PowerMenuItem("Travel", false))
.setAnimation(MenuAnimation.SHOWUP_TOP_LEFT) // Animation start point (TOP | LEFT)
.setMenuRadius(10f)
.setMenuShadow(10f)
.setTextColor(context.getResources().getColor(R.color.md_grey_800))
.setSelectedTextColor(Color.WHITE)
.setMenuColor(Color.WHITE)
.setSelectedMenuColor(context.getResources().getColor(R.color.colorPrimary))
.setOnMenuItemClickListener(onMenuItemClickListener)
.build();

You can add items or item List using PowerMenuItem class. This is how to initialize PowerMenuItem.

PowerMenuItem powerMenuItem = new PowerMenuItem(“Travel”, true);

At first, argument is item Title, and the other is setting selected status. If true, the item’s text or background colour is changed by your settings like below:

.setSelectedTextColor(Color.WHITE)

.setSelectedMenuColor(context.getResources().getColor(R.color.colorPrimary))

You can listen to item click.

private OnMenuItemClickListener<PowerMenuItem> onMenuItemClickListener = new OnMenuItemClickListener<PowerMenuItem>() {

@Override

public void onItemClick(int position, PowerMenuItem item) {

Toast.makeText(getBaseContext(), item.getTitle(), Toast.LENGTH_SHORT).show();

powerMenu.setSelected(position); // change selected item

powerMenu.dismiss();

}

};

and the last, show popup

powerMenu.showAsDropDown(view); // view is an anchor

or

powerMenu.showAsDropDown(view, (int)xOffset, (int)yOffset);

Source

Social Networks:

Twitter

Facebook