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
/** | |
* Make an int random array with value from 0 to max | |
* @param size: size = max + 1 | |
* @return result: an int array | |
*/ | |
private int[] makeRandomArray(int size) { | |
int result[] = new int[size]; | |
List<Integer> ascesdingArray = new ArrayList<>(); | |
for (int i = 0; i < size; i++) { | |
ascesdingArray.add(i); |
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 animation on anim folder | |
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); | |
transaction.setCustomAnimations(R.anim.enter_to_left, R.anim.exit_left, R.anim.enter_to_right, R.anim.exit_right); |
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.content.Context; | |
import android.graphics.Rect; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import android.view.ViewGroup; | |
/** | |
* from the question: http://stackoverflow.com/questions/26649406/nested-recycler-view-height-doesnt-wrap-its-content | |
*/ |
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.samsung.android.tests.snote; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.text.DecimalFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; |
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
Hex Opacity Values | |
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF | |
70% — B3 | |
65% — A6 |
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
// divide two unknown length texts to fit fixed parent width | |
private void adjustEmployeeInfoLayoutWidth() { | |
int dp10 = PlandayUtils.dpToPx(getContext(), 10); | |
int dp15 = PlandayUtils.dpToPx(getContext(), 15); | |
int dp50 = PlandayUtils.dpToPx(getContext(), 50); | |
// civAvatar.width = 50dp + marginLeft = 15dp, nameMarginLeft = 10dp, roleMarginLeft = 15dp, roleMarginRight = 15dp | |
int parentWidth = PlandayUtils.getScreenSize(getContext())[0] - dp50 - 3 * dp15 - dp10; | |
int nameWidth = (int) tvEmployeeName.getPaint().measureText(tvEmployeeName.getText().toString()); | |
int roleWidth = (int) tvRoleName.getPaint().measureText(tvRoleName.getText().toString()); |
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
for (int i = 568; i <= 647; i++) { | |
String fileName1 = "Image#" + i + ".jpg"; | |
//String fileName2 = "image"+i+".jpg"; | |
//File file1 = new File(PATH+"/"+fileName1); | |
//File file2 = new File(PATH+"/"+fileName2); | |
if (file1.exists()) { | |
file1.renameTo(file2); | |
} | |
Bitmap bitmap = BitmapFactory.decodeFile(PATH + File.separator + fileName1); | |
Bitmap resized = Bitmap.createBitmap(bitmap, 0, bitmap.getHeight() / 8 + 10, bitmap.getWidth(), bitmap.getHeight() / 2 - 3); |
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 TLog { | |
private static final int V = 0; | |
private static final int D = 1; | |
private static final int I = 2; | |
private static final int W = 3; | |
private static final int E = 4; | |
private static final String TAG = "CustomLog"; |
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 POGOProtos.Enums.PokemonIdOuterClass; | |
import com.pokegoapi.api.PokemonGo; | |
import com.pokegoapi.api.map.pokemon.CatchablePokemon; | |
import com.pokegoapi.api.map.pokemon.NearbyPokemon; | |
import com.pokegoapi.auth.GoogleUserCredentialProvider; | |
import com.pokegoapi.exceptions.LoginFailedException; | |
import com.pokegoapi.exceptions.RemoteServerException; | |
import okhttp3.OkHttpClient; | |
import java.io.IOException; |
OlderNewer