This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2018 *********. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.nemanjakovacevic.recyclerviewswipetodelete; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.drawable.ColorDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
class MyItemDecoration extends RecyclerView.ItemDecoration { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package co.neatapps.android.samples; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import java.lang.reflect.ParameterizedType; | |
public class Prefs { | |
public static final ValueWrapper<Boolean> SAMPLE_BOOL_TOKEN = new ValueWrapper<Boolean>("SAMPLE_BOOL_TOKEN", false) { | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> | |
<!-- Selected --> | |
<item android:state_focused="true" android:state_pressed="false"> | |
<shape> | |
<solid android:color="#00ffffff" /> | |
</shape> | |
</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- Selected --> | |
<item android:state_focused="true" android:state_pressed="false"> | |
<shape> | |
<solid android:color="#00ffffff" /> | |
</shape> | |
</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.neatapps.avi.app.util; | |
import android.app.Activity; | |
import android.content.ComponentName; | |
import android.content.Intent; | |
import android.content.pm.ActivityInfo; | |
import android.content.pm.PackageManager; | |
import android.content.pm.ResolveInfo; | |
import android.net.Uri; | |
import android.os.Build; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static final String PREFERENCES_FILE = "preferences.txt"; | |
SharedPreferences preferences = this.getSharedPreferences(PREFERENCES_FILE, MODE_PRIVATE); | |
String pref1Value = preferences.getString("PREF_1", ""); // This get value of PREF_1 key | |
SharedPreferences.Editor edit = preferences.edit(); | |
edit.putString("key", "value"); // This put value to PREF_1 key | |
edit.commit(); // This write preferences to disk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { // this hide ActionBar in Android app | |
getWindow().requestFeature(Window.FEATURE_ACTION_BAR); | |
getActionBar().hide(); | |
} catch (NullPointerException ignore) { | |
} |