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.edinstudio.app.samples.multiplerowradiobuttons; | |
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import android.view.View; | |
import android.widget.RadioGroup; | |
import android.widget.Toast; | |
public class MainActivity extends ActionBarActivity { |
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 MainActivity extends Activity { | |
private ScreenStateReceiver mReceiver; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_SCREEN_ON); | |
intentFilter.addAction(Intent.ACTION_SCREEN_OFF); |
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 RainbowTextView extends TextView { | |
protected void onSizeChanged(int w, int h, int oldw, int oldh) { | |
super.onSizeChanged(w, h, oldw, oldh); | |
int[] rainbow = getRainbowColors(); | |
Shader shader = new LinearGradient(0, 0, 0, w, rainbow, | |
null, Shader.TileMode.MIRROR); | |
Matrix matrix = new Matrix(); | |
matrix.setRotate(90); |
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
Uri video = Uri.parse("android.resource://" + getPackageName() + "/" | |
+ R.raw.mrwind); | |
main_vv.setVideoURI(video); |
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
private class TimePickerFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener { | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
int hourOfDay = calendar.get(Calendar.HOUR_OF_DAY); | |
int minute = calendar.get(Calendar.MINUTE); | |
return new TimePickerDialog(getActivity(), this, hourOfDay, minute, true); | |
} |
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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<ProgressBar | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:indeterminate="true" |
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 NonSwipeableViewPager extends ViewPager { | |
public NonSwipeableViewPager(Context context) { | |
super(context); | |
} | |
public NonSwipeableViewPager(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} |
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
/** | |
* A custom DialogFragment that is positioned above given "source" component. | |
* | |
* @author Jonik, http://stackoverflow.com/a/20419231/56285 | |
*/ | |
public class ConfirmBox extends DialogFragment { | |
private View source; | |
public ConfirmBox() { | |
} |
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
/** Download books from www.guoxue123.cn | |
* usage: node downloader.js <index page> | |
* example: node downloader.js www.guoxue123.cn/xiaosuo/jd/jpshz/index.htm | |
*/ | |
var http = require('http'); | |
var url = require('url'); | |
var parser = require('cheerio'); | |
var iconv = require('iconv').Iconv('GBK', 'UTF-8'); | |
var fs = require('fs'); |
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 UserPanelDialogFragment extends DialogFragment implements View.OnClickListener { | |
private boolean isLogin = false; | |
private TextView mRegister; | |
private TextView mLogin; | |
private TextView mFeedback; | |
private TextView mUserId; | |
private TextView mLogout; |
NewerOlder