This file contains hidden or 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.rocboronat.android.utils; | |
import java.lang.reflect.Method; | |
import java.util.Set; | |
import android.bluetooth.BluetoothAdapter; | |
import android.bluetooth.BluetoothDevice; | |
import android.util.Log; | |
public class BluetoothUtil { |
This file contains hidden or 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
<resources> | |
<!-- http://developer.android.com/design/style/metrics-grids.html --> | |
<dimen name="gap_small">4dp</dimen> | |
<dimen name="gap_medium">8dp</dimen> | |
<dimen name="gap_large">16dp</dimen> | |
<dimen name="gap_xlarge">32dp</dimen> | |
<dimen name="gap_xxlarge">64dp</dimen> | |
<!-- http://developer.android.com/design/style/typography.html --> |
This file contains hidden or 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
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
MenuInflater inflater = getMenuInflater(); | |
inflater.inflate(R.menu.menu_listoffers, menu); | |
new Handler().post(new Runnable() { | |
@Override | |
public void run() { | |
final View menuItemView = findViewById(R.id.action_search); |
This file contains hidden or 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
private void setTaskDescription(){ | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
String title = getString(R.string.app_name); | |
Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher); | |
int color = getResources().getColor(R.color.task_background); | |
// The legacy method call | |
// setTaskDescription(new ActivityManager.TaskDescription(title, icon, color)); | |
// The reflected method call |
This file contains hidden or 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.fewlaps.android.quitnow.base.customview; | |
import android.os.Handler; | |
import android.view.View; | |
/**A simple way to call the common new Handler().postDelayed(..., time); | |
* | |
* Created by Roc Boronat on 12/12/2014. | |
*/ | |
public class RippleDelayedRunner implements View.OnClickListener { |
This file contains hidden or 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.infojobs.app.base.utils.animation; | |
import android.graphics.PointF; | |
import android.view.animation.Interpolator; | |
/** | |
* Derived from: https://github.com/rdallasgray/bez | |
*/ | |
public class CubicBezierInterpolator implements Interpolator { |
This file contains hidden or 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 String getDateMonthFromStrings(Context context, DateTime date) { | |
String result; | |
if (date.getMonthOfYear() == 1) { | |
result = context.getString(R.string.month_january); | |
} else if (date.getMonthOfYear() == 2) { | |
result = context.getString(R.string.month_february); | |
} else if (date.getMonthOfYear() == 3) { | |
result = context.getString(R.string.month_march); | |
} else if (date.getMonthOfYear() == 4) { | |
result = context.getString(R.string.month_april); |
This file contains hidden or 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.infojobs.app.base.view.fragment; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.app.Dialog; | |
import android.content.DialogInterface; | |
import android.os.Bundle; | |
import android.support.v4.app.DialogFragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.view.LayoutInflater; |
This file contains hidden or 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 color = palette.getVibrantColor(defaultColor); | |
int r = (color >> 16) & 0xFF; | |
int g = (color >> 8) & 0xFF; | |
int b = (color >> 0) & 0xFF; | |
row.setBackgroundColor(color); | |
//@see http://stackoverflow.com/questions/12043187/how-to-check-if-hex-color-is-too-black | |
double luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; |
This file contains hidden or 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 at.rocboron.android.utils; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.WindowManager; | |
import android.view.inputmethod.InputMethodManager; | |
public class SoftKeyboardUtil { |
OlderNewer