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
#!/bin/bash | |
# Check if the last commit is a merge commit | |
# by getting commit parents (for merge there would be two parents) | |
if [[ $(git log --format=%P -n 1 | wc -w) -gt 1 ]]; then | |
LAST_COMMIT=$(git rev-parse HEAD) | |
MERGE_HASHES=$(git log --pretty=format:%H $LAST_COMMIT~...$LAST_COMMIT) | |
COMMIT_MESSAGE="" | |
# Loop through each merge commit and extract messages |
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.annotation.TargetApi; | |
import android.app.Service; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.os.Build; | |
import android.support.annotation.DrawableRes; | |
import android.text.Editable; | |
import android.text.InputFilter; | |
import android.text.InputType; | |
import android.text.TextWatcher; |
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 Drawable getColoredDrawable(@NonNull Context context, @DrawableRes int drawableRes, | |
@ColorRes int colorRes) { | |
Drawable drawable = ContextCompat.getDrawable(context, drawableRes); | |
int color = ContextCompat.getColor(context, colorRes); | |
Drawable wrappedDrawable = DrawableCompat.wrap(drawable); | |
DrawableCompat.setTint(wrappedDrawable, color); | |
return wrappedDrawable; | |
} |
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
Drawable img = ContextCompat.getDrawable(mContext, item.getTimerImage()); | |
img.setColorFilter(ContextCompat.getColor(mContext, R.color.white), PorterDuff.Mode.SRC_ATOP); |
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.text.Layout.Alignment; | |
import android.text.StaticLayout; | |
import android.text.TextPaint; | |
import android.util.AttributeSet; | |
import android.util.TypedValue; | |
import android.widget.TextView; | |
/** | |
* Text view that auto adjusts text size to fit within the view. |
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
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_dropdown_item) { | |
@Override | |
public View getView(int position, View convertView, ViewGroup parent) { | |
View v = super.getView(position, convertView, parent); | |
if (position == getCount()) { | |
((TextView)v.findViewById(android.R.id.text1)).setText(""); | |
((TextView)v.findViewById(android.R.id.text1)).setHint(getItem(getCount())); //"Hint to be displayed" | |
} |
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
double d1 = 1.234567; | |
double d2 = 2; | |
NumberFormat nf = new DecimalFormat("##.###"); | |
System.out.println(nf.format(d1)); | |
System.out.println(nf.format(d2)); |
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.nix.betavest.activities; | |
/** | |
* Created by vlevytskyy on 18.03.2015. | |
*/ | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; |
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
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:background="@android:color/transparent" | |
android:padding="5dp" | |
android:id="@+id/status" | |
android:orientation="horizontal" | |
android:visibility="visible" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content"> | |
<TableRow |
NewerOlder