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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.7.0' | |
} | |
} |
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
//Automatically calculates Y axis values. | |
private Axis calculateYAxis(int numberOfSteps) { | |
if (numberOfSteps < 2) { | |
throw new | |
IllegalArgumentException("Number or steps have to be grater or equal 2"); | |
} | |
List<Float> values = new ArrayList<Float>(); | |
final float range = mData.getMaxYValue() - mData.getMinYValue(); | |
final float tickRange = range / (numberOfSteps - 1); | |
final float x = (float) Math.ceil(Math.log10(tickRange) - 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
package lecho.lib.hellocharts.util; | |
import android.graphics.RectF; | |
/** | |
* Cohen-Sutherland algorithm implementation based on wikipedia article. | |
* | |
* {@link http://en.wikipedia.org/wiki/Cohen-Sutherland_algorithm} | |
* | |
*/ |
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 lecho.lib.hellocharts.util; | |
import android.graphics.PointF; | |
/** | |
* Iterative implementation of de Casteljau's algorithm for cubic Bezier's curves. | |
* | |
*/ | |
public class CasteljauComputator { | |
private static final int DEFAULT_CURVE_DEGREE = 3;// By default cubic. |
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
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View rootView = inflater.inflate(R.layout.fragment_line_column_dependency, container, false); | |
// *** TOP LINE CHART *** | |
chartTop = (LineChartView) rootView.findViewById(R.id.chart_top); | |
// Generate and set data for line chart | |
generateInitialLineData(); |
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.github.lecho.mobilization; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.os.Build; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; |
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 ImageZoomView extends ImageView { | |
Matrix matrix = new Matrix(); | |
// Three possible states. | |
static final int NONE = 0; | |
static final int PAN = 1; | |
static final int ZOOM = 2; | |
static final int CLICK = 3; | |
int mode = NONE; |
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 CustomScrollView extends ScrollView { | |
private GestureDetector mGestureDetector; | |
public CustomScrollView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
mGestureDetector = new GestureDetector(context, new YScrollDetector()); | |
setFadingEdgeLength(0); | |
} |
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
adb -d shell 'run-as com.yourpackage cat /data/data/com.yourpackage/databases/dbname > /sdcard/dbname' |
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.database.Cursor; | |
import android.support.v4.content.AsyncTaskLoader; | |
public abstract class SimpleCursorLoader extends AsyncTaskLoader<Cursor> { | |
private Cursor mCursor; | |
public SimpleCursorLoader(Context context) { | |
super(context); | |
} |
OlderNewer