Skip to content

Instantly share code, notes, and snippets.

BitmapFactory.Options options = new BitmapFactory.Options();
options.outHeight = canvas.getHeight(); //得到100
options.outWidth = canvas.getHeight(); //得到100
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.progressbar_triangle_node,options);
canvas.drawBitmap(bitmap,0,0,m_textPaint);
canvas.restore();
BitmapFactory.Options options = new BitmapFactory.Options();
options.outHeight = canvas.getHeight(); //100
options.outWidth = canvas.getHeight(); /100
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.progressbar_triangle_node,options);
int w = bitmap.getWidth(); /15
int h = bitmap.getHeight(); /15
if(null == this.container){
this.container = (ViewGroup) inflater.inflate(getLayoutResId(), container, false);
swipeRefreshLayout = findViewTById(this.container,R.id.swipeRefreshLayout);
findView(this.container);
setupViewComponent();
}else{
try {
ViewGroup viewParent = (ViewGroup) this.container.getParent();
viewParent.removeView(this.container);
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if(null == this.container){
this.container = (ViewGroup) inflater.inflate(getLayoutResId(), container, false);
swipeRefreshLayout = findViewTById(this.container,R.id.swipeRefreshLayout);
findView(this.container);
setupViewComponent();
}else{
try {
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient android:startColor="#ff000000"
android:centerColor="#ff000000"
android:endColor="#00000000"
android:type="linear"
android:angle="270"
android:centerX="0.9"
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: FATAL EXCEPTION: main
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: Process: com.set.settv, PID: 14725
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: java.lang.AssertionError
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: at com.google.g.b.a.bg.<init>(TypeAdapters.java:733)
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: at com.google.g.b.a.at.a(TypeAdapters.java:759)
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: at com.google.g.j.a(Gson.java:359)
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: at com.google.g.b.a.q.a(ReflectiveTypeAdapterFactory.java:122)
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: at com.google.g.b.a.q.a(ReflectiveTypeAdapterFactory.java:46)
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: at com.google.g.b.a.r.<init>(ReflectiveTypeAdapterFactory.java:92)
10-12 14:00:10.049 14725-14725/? E/AndroidRuntime: at com.google.g.b.a.q.a(ReflectiveTypeAdapterFactory.java:91)
package com.set.settv.manager;
import com.google.gson.Gson;
import org.json.JSONArray;
import org.json.JSONObject;
/**
* Created by USER on 2015/9/22.
*/
package tw.guodong.commoncode.mvc.activity;
import android.support.v7.app.AppCompatActivity;
import tw.guodong.commoncode.activity.BaseActivity;
/**
* Created by USER on 2015/10/23.
*/
public class MVCActivity extends BaseActivity {
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".HomePageActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="@color/main_color">
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".HomePageActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true">