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
android:shadowColor="#000" | |
android:shadowDx="-2" | |
android:shadowDy="-2" | |
android:shadowRadius="5" | |
<TextView | |
android:id="@+id/title_tv" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" |
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
buildConfigField "String[]", "STRING_LIST", | |
"{" + | |
"\"String 1\"" + | |
"}" |
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
import android.media.MediaPlayer; | |
import android.media.RingtoneManager; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import androidx.appcompat.app.AppCompatActivity; | |
import java.io.IOException; | |
public class MainActivity extends AppCompatActivity { |
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 class Toggler { | |
private static final int DEFAULT_MODE = 1; //count = 2: *,-,*,-,*,-,*,-... | |
//count = 1: *,*,*,*,*,*,*,*... | |
//count = 3: *,-,-,*,-,-,*,-... | |
public static final int WAIT_MODE = 2; //count = 2: -,*,*,*,*,*,*,*,*... | |
//count = 1: *,*,*,*,*,*,*,*,*... | |
//count = 3: -,-,*,*,*,*,*,*,*... | |
private int mMode = DEFAULT_MODE; |
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
intermidiateTint="#fff" |
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 class Repeater { | |
private final int mEach; | |
private int mLap; | |
public Repeater(int each) { | |
this.mEach = each; | |
this.mLap = each; | |
} |
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 com.oliverstudio.firestoreadmintest1; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.ProgressBar; | |
import androidx.appcompat.app.AppCompatActivity; | |
import com.google.firebase.firestore.CollectionReference; |
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
int switcher = 0; | |
int countLaps = 3; | |
switch (switcher) { | |
case 0: | |
switcher = (switcher+1)%countLaps; | |
break; | |
case 1: | |
switcher = (switcher+1)%countLaps; |
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
//What the problem? | |
//If you will put the String Set to Shared Preferences with a putStringSet() method it will be put, | |
//but for second iteration and more it is work uncorrectly. Let's see | |
public class MainActivity extends AppCompatActivity { | |
private Button mFirstButton, mSecondButton; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
//put | |
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); | |
SharedPreferences.Editor editor = sharedPreferences.edit(); | |
editor.putInt("tag_number", 10); | |
editor.apply(); | |
//get | |
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); | |
int x = sharedPreferences.getInt("tag_number", 0); |
NewerOlder