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.vogella.android.customview.compoundview; | |
import com.vogella.android.view.compoundview.R; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.view.Gravity; | |
import android.view.LayoutInflater; | |
import android.view.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
// Defines a list of columns to retrieve from the Cursor and load into an output row | |
String[] mWordListColumns ={ | |
UserDictionary.Words.WORD, // Contract class constant containing the word column name UserDictionary.Words.LOCALE // Contract class constant containing the locale column name | |
}; | |
// Defines a list of View IDs that will receive the Cursor columns for each row | |
int[] mWordListItems = { R.id.dictWord, R.id.locale}; | |
// Creates a new SimpleCursorAdapter | |
mCursorAdapter = new SimpleCursorAdapter( | |
getApplicationContext(), // 上下文对象 | |
R.layout.wordlistrow, // ListView的Item(一行) |
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
/* | |
* This defines a one-element String array to contain the selection argument. | |
*/ | |
String[] mSelectionArgs = {""}; | |
// 从UI中获取单词 | |
mSearchString = mSearchWord.getText().toString(); | |
// Remember to insert code here to check for invalid or malicious input. | |
// 如果为空,则获取全部单词 | |
if (TextUtils.isEmpty(mSearchString)) { | |
// 设置选择条件为空,会返回所有 |
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
// 查询返回的列 | |
String[] mProjection ={ | |
UserDictionary.Words._ID, // Contract class constant for the _ID column name | |
UserDictionary.Words.WORD, // Contract class constant for the word column name | |
UserDictionary.Words.LOCALE // Contract class constant for the locale column name}; | |
// 查询条件 | |
String mSelectionClause = null; | |
// 查询条件的参数值 | |
String[] mSelectionArgs = {""}; |
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
// Queries the user dictionary and returns results | |
mCursor = getContentResolver().query( | |
UserDictionary.Words.CONTENT_URI, // The content URI of the words table | |
mProjection, // The columns to return for each row | |
mSelectionClause // Selection criteria | |
mSelectionArgs, // Selection criteria | |
mSortOrder); |
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 CircularProgressDrawable extends Drawable | |
implements Animatable { | |
private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator(); | |
private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator(); | |
private static final int ANGLE_ANIMATOR_DURATION = 2000; | |
private static final int SWEEP_ANIMATOR_DURATION = 600; | |
private static final int MIN_SWEEP_ANGLE = 30; | |
private final RectF fBounds = new RectF(); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder