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
mScrollView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() { | |
@Override | |
public void onScrollChanged() { | |
// the scrollposition that the fade will start | |
int mScrollThreshold = 100; | |
// how fast the view will fade with the scroll -- use multiples of 10 | |
int mScrollVariance = 40; | |
int scrollY = mScrollView.getScrollY(); | |
// if the difference between the scrollthreshold is +/-mScrollVariance, show the view accordingly | |
float newAlpha = 0; |
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
mProgressBar.getViewTreeObserver() | |
.addOnGlobalLayoutListener( | |
new OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { | |
//... do code here | |
} | |
}); |
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
final Dialog dialog = new Dialog(this); | |
// remove the title | |
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); | |
// set the layout | |
dialog.setContentView(R.layout.dialog_series_info); | |
// do whatever you need to with the data | |
TextView title = (TextView)dialog.findViewById(R.id.series_title); | |
title.setText(mSeriesTitle); | |
dialog.show(); |
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
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Rect; | |
import android.graphics.RectF; | |
import android.graphics.Bitmap.Config; | |
import android.graphics.PorterDuff.Mode; | |
import android.graphics.drawable.BitmapDrawable; |