Files

11 lines
1.2 KiB
Java
Raw Permalink Normal View History

package cn.ucvl.zhaodisplay;
import android.graphics.*;
import org.json.*;
/** Clearly labelled placeholder: no map tiles or real coordinates in this offline fixture. */
final class LocationMapView extends android.view.View {
JSONArray items;JSONObject focused;Paint p=new Paint(3);
LocationMapView(android.content.Context c){super(c);setContentDescription("地图占位,隔离验收不加载真实位置");}
void setItems(JSONArray a){items=a;invalidate();}void setTrack(JSONArray a){}void reset(){}void focus(JSONObject p){focused=p;}void resumeMap(){}void pauseMap(){setItems(new JSONArray());}void close(){}
protected void onDraw(Canvas c){c.drawColor(0xffe7eee5);float d=getResources().getDisplayMetrics().density;p.setColor(0xffc9d9ce);p.setStrokeWidth(2*d);for(int x=0;x<getWidth();x+=60*d)c.drawLine(x,0,x,getHeight(),p);for(int y=0;y<getHeight();y+=60*d)c.drawLine(0,y,getWidth(),y,p);p.setColor(PhoneStyle.MUTED);p.setTextSize(15*d);p.setTextAlign(Paint.Align.CENTER);c.drawText("智家地图 · 隔离验收占位",getWidth()/2f,getHeight()/2f,p);p.setTextSize(12*d);c.drawText("正式版加载已授权家人位置",getWidth()/2f,getHeight()/2f+25*d,p);}
}