Skip to content

Instantly share code, notes, and snippets.

View harshabhadra's full-sized avatar
🏠

Harsha Bhadra harshabhadra

🏠
View GitHub Profile
@harshabhadra
harshabhadra / EmployeeLinkedList.java
Created June 28, 2022 06:04
Sample of Custom Single LinkedList
public class EmployeeLinkedList {
private EmployeeNode head;
private int size;
public void addToFront(Employee employee) {
EmployeeNode node = new EmployeeNode(employee);
node.setNext(head);
head = node;
size++;
// [START display_welcome_message]
private void displayWelcomeMessage() {
// [START get_config_values]
String welcomeMessage = mFirebaseRemoteConfig.getString(WELCOME_MESSAGE_KEY);
String versionName = mFirebaseRemoteConfig.getString(VERSION_NAME_KEY);
if (versionName.equals(version) && mFirebaseRemoteConfig.getBoolean(CREATE_FORCE_UPDATE_DIALOG_KEY)) {
Log.e(TAG, "true");
//Get the version name
private String getVersionName(Context context) {
PackageInfo pInfo = null;
try {
pInfo = context.getPackageManager().getPackageInfo(getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return pInfo.versionName;
}
/**
* Fetch a welcome message from the Remote Config service, and then activate it.
*/
private void fetchWelcome() {
mWelcomeTextView.setText(mFirebaseRemoteConfig.getString(LOADING_PHRASE_CONFIG_KEY));
// [START fetch_config_with_callback]
mFirebaseRemoteConfig.fetchAndActivate()
.addOnCompleteListener(this, new OnCompleteListener<Boolean>() {
@Override
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mWelcomeTextView = findViewById(R.id.textView);
versionNameTextView = findViewById(R.id.version_name);
// Get Remote Config instance.
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
// Remote Config keys
private static final String LOADING_PHRASE_CONFIG_KEY = "loading_phrase";
private static final String WELCOME_MESSAGE_KEY = "welcome_message";
private static final String CREATE_FORCE_UPDATE_DIALOG_KEY = "create_force_update_dialog";
private static final String VERSION_NAME_KEY = "version_name";
String MY_APP_URL = "https://play.google.com/store/apps/details?id=com.technoidtintin.android.moviesmela";
String version;
<defaultsMap>
<entry>
<key>loading_phrase</key>
<value>Fetching config</value>
</entry>
<entry>
<key>create_force_update_dialog</key>
<value>false</value>
</entry>
<entry>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/textView"
@harshabhadra
harshabhadra / README.md
Created September 23, 2019 12:52 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha: