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
// Bitmap bitmap; | |
// | |
// if (drawable instanceof BitmapDrawable) { | |
// BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; | |
// if (bitmapDrawable.getBitmap() != null) { | |
// return bitmapDrawable.getBitmap(); | |
// } | |
// } | |
// | |
// if (drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 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
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | |
getSupportActionBar().setTitle("Login"); | |
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.bar_color))); | |
getSupportActionBar().hide(); |
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
private void initToolBar() { | |
toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar); | |
// App Logo | |
//toolbar.setLogo(R.mipmap.ic_launcher); | |
// Title | |
toolbar.setTitle("Login"); | |
// Sub Title | |
//toolbar.setSubtitle("Sub title"); | |
//toolbar.setTitleTextColor(getResources().getColor(R.color.white)); |
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
DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "notes-db", null); | |
db = helper.getWritableDatabase(); | |
daoMaster = new DaoMaster(db); | |
daoSession = daoMaster.newSession(); | |
boxDao = daoSession.getBoxDao(); | |
Box box = new Box(null, "魔方", 1, "魔方描述"); | |
boxDao.insert(box); | |
Logger.d("Inserted new note, ID: " + box.getId()); |
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
File dir = Environment.getExternalStorageDirectory();//获取SD卡目录 | |
File file = new File(dir, "girl.jpg");//文件必须存在,自己放个同名的图片过去 | |
AQuery aq = new AQuery(TestActivity.this); | |
String url = APIAgent.URL_SERVER_IMPRESSION_UPLOAD; | |
Map<String, Object> params = new HashMap<String, Object>(); | |
params.put("message", "Message"); | |
params.put("file", file);//可以传二进制数据也可以传文件 | |
AjaxCallback<String> cb = new AjaxCallback<String>() { | |
@Override |
NewerOlder