Relation1控件之间的布局LayoutbelowL.docx

上传人:b****5 文档编号:29964688 上传时间:2023-08-03 格式:DOCX 页数:30 大小:22.64KB
下载 相关 举报
Relation1控件之间的布局LayoutbelowL.docx_第1页
第1页 / 共30页
Relation1控件之间的布局LayoutbelowL.docx_第2页
第2页 / 共30页
Relation1控件之间的布局LayoutbelowL.docx_第3页
第3页 / 共30页
Relation1控件之间的布局LayoutbelowL.docx_第4页
第4页 / 共30页
Relation1控件之间的布局LayoutbelowL.docx_第5页
第5页 / 共30页
点击查看更多>>
下载资源
资源描述

Relation1控件之间的布局LayoutbelowL.docx

《Relation1控件之间的布局LayoutbelowL.docx》由会员分享,可在线阅读,更多相关《Relation1控件之间的布局LayoutbelowL.docx(30页珍藏版)》请在冰豆网上搜索。

Relation1控件之间的布局LayoutbelowL.docx

Relation1控件之间的布局LayoutbelowL

BasicPythonExercises基础练习之StrinBean对象转移对象浅层复制复制,bean属性的读写操作及类型转换工具类,bootstrap对col-vp-push/pull-x的解释,bootstrap经典全屏轮番

C语言的CPS实现——求Fibonacci数列

[代码]/res/layout/widget_layout.xml

xmlversion="1.0"encoding="utf-8"?

>

android="schemas.android/apk/res/android"

android:

id="@+id/widget"

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

focusable="true"

style="@style/WidgetBackground">

android:

id="@+id/app_name"

android:

layout_width="wrap_content"

android:

layout_height="wrap_content"

android:

layout_marginTop="14dip"

android:

layout_marginBottom="1dip"

android:

includeFontPadding="false"

android:

singleLine="true"

android:

ellipsize="end"

style="@style/Text.WordTitle"/>

android:

id="@+id/movie_name"

android:

layout_width="fill_parent"

android:

layout_height="wrap_content"

android:

layout_below="@id/app_name"

android:

paddingRight="5dip"

android:

paddingBottom="4dip"

android:

includeFontPadding="false"

android:

lineSpacingMultiplier="0.9"

android:

maxLines="4"

android:

fadingEdge="vertical"

style="@style/Text.Movie"/>

//C#TextBox控件内容随文本文档改动提示更新

//C#程序定期把内存信息记录在LOG目录下

//C#动态编译-执行对象方法

[代码]res/values/styles.xml

xmlversion="1.0"encoding="utf-8"?

>

background">@drawable/widget_bg

textSize">16sp

textStyle">bold

textColor">@android:

color/black

textSize">13sp

textColor">@android:

color/black

[代码]AndroidManifest.xml

icon="@drawable/icon"android:

label="@string/app_name">

...

--BroadcastReceiverthatwillprocessAppWidgetupdates-->

name=".widget.MovieSearchWidget"android:

label="@string/widget_name">

name="android.appwidget.action.APPWIDGET_UPDATE"/>

name="android.appwidget.provider"android:

resource="@xml/movie_search_widget"/>

--ServicetoperformwebAPIqueries-->

name=".widget.MovieSearchWidget$UpdateService"/>

...

[代码]LbsGeocodingActivity.java

packagecom.javacodegeeks.android.lbs;

importandroid.app.Activity;

importandroid.content.Context;

importandroid.location.Location;

importandroid.location.LocationListener;

importandroid.location.LocationManager;

importandroid.os.Bundle;

importandroid.view.View;

importandroid.view.View.OnClickListener;

importandroid.widget.Button;

importandroid.widget.Toast;

publicclassLbsGeocodingActivityextendsActivity{

privatestaticfinallongMINIMUM_DISTANCE_CHANGE_FOR_UPDATES=1;//inMeters

privatestaticfinallongMINIMUM_TIME_BETWEEN_UPDATES=1000;//inMilliseconds

protectedLocationManagerlocationManager;

protectedButtonretrieveLocationButton;

@Override

publicvoidonCreate(BundlesavedInstanceState){

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

retrieveLocationButton=(Button)findViewById(R.id.retrieve_location_button);

locationManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);

locationManager.requestLocationUpdates(

LocationManager.GPS_PROVIDER,

MINIMUM_TIME_BETWEEN_UPDATES,

MINIMUM_DISTANCE_CHANGE_FOR_UPDATES,

newMyLocationListener()

);

retrieveLocationButton.setOnClickListener(newOnClickListener(){

@Override

publicvoidonClick(Viewv){

showCurrentLocation();

}

});

}

protectedvoidshowCurrentLocation(){

Locationlocation=locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

if(location!

=null){

Stringmessage=String.format(

"CurrentLocation\nLongitude:

%1$s\nLatitude:

%2$s",

location.getLongitude(),location.getLatitude()

);

Toast.makeText(LbsGeocodingActivity.this,message,

Toast.LENGTH_LONG).show();

}

}

privateclassMyLocationListenerimplementsLocationListener{

publicvoidonLocationChanged(Locationlocation){

Stringmessage=String.format(

"NewLocation\nLongitude:

%1$s\nLatitude:

%2$s",

location.getLongitude(),location.getLatitude()

);

Toast.makeText(LbsGeocodingActivity.this,message,Toast.LENGTH_LONG).show();

}

publicvoidonStatusChanged(Strings,inti,Bundleb){

Toast.makeText(LbsGeocodingActivity.this,"Providerstatuschanged",

Toast.LENGTH_LONG).show();

}

publicvoidonProviderDisabled(Strings){

Toast.makeText(LbsGeocodingActivity.this,

"Providerdisabledbytheuser.GPSturnedoff",

Toast.LENGTH_LONG).show();

}

publicvoidonProviderEnabled(Strings){

Toast.makeText(LbsGeocodingActivity.this,

"Providerenabledbytheuser.GPSturnedon",

Toast.LENGTH_LONG).show();

}

}

}

[代码]GMapsActivity.java

packagecom.javacodegeeks.android.googlemaps;

importjava.util.List;

importandroid.graphics.drawable.Drawable;

importandroid.os.Bundle;

importcom.google.android.maps.GeoPoint;

importcom.google.android.maps.MapActivity;

importcom.google.android.maps.MapController;

importcom.google.android.maps.MapView;

importcom.google.android.maps.Overlay;

importcom.google.android.maps.OverlayItem;

publicclassGMapsActivityextendsMapActivity{

privateMapViewmapView;

privatestaticfinalintlatitudeE6=37985339;

privatestaticfinalintlongitudeE6=23716735;

@Override

publicvoidonCreate(BundlesavedInstanceState){

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

mapView=(MapView)findViewById(R.id.map_view);

mapView.setBuiltInZoomControls(true);

ListmapOverlays=mapView.getOverlays();

Drawabledrawable=this.getResources().getDrawable(R.drawable.icon);

CustomItemizedOverlayitemizedOverlay=

newCustomItemizedOverlay(drawable,this);

GeoPointpoint=newGeoPoint(latitudeE6,longitudeE6);

OverlayItemoverlayitem=

newOverlayItem(point,"Hello","I'minAthens,Greece!

");

itemizedOverlay.addOverlay(overlayitem);

mapOverlays.add(itemizedOverlay);

MapControllermapController=mapView.getController();

mapController.animateTo(point);

mapController.setZoom(6);

}

@Override

protectedbooleanisRouteDisplayed(){

returnfalse;

}

}

[代码]CustomItemizedOverlay.java

packagecom.javacodegeeks.android.googlemaps;

importjava.util.ArrayList;

importandroid.app.AlertDialog;

importandroid.content.Context;

importandroid.graphics.drawable.Drawable;

importcom.google.android.maps.ItemizedOverlay;

importcom.google.android.maps.OverlayItem;

publicclassCustomItemizedOverlayextendsItemizedOverlay{

privateArrayListmapOverlays=newArrayList();

privateContextcontext;

publicCustomItemizedOverlay(DrawabledefaultMarker){

super(boundCenterBottom(defaultMarker));

}

publicCustomItemizedOverlay(DrawabledefaultMarker,Contextcontext){

this(defaultMarker);

this.context=context;

}

@Override

protectedOverlayItemcreateItem(inti){

returnmapOverlays.get(i);

}

@Override

publicintsize(){

returnmapOverlays.size();

}

@Override

protectedbooleanonTap(intindex){

OverlayItemitem=mapOverlays.get(index);

AlertDialog.Builderdialog=newAlertDialog.Builder(context);

dialog.setTitle(item.getTitle());

dialog.setMessage(item.getSnippet());

dialog.show();

returntrue;

}

publicvoidaddOverlay(OverlayItemoverlay){

mapOverlays.add(overlay);

this.populate();

}

}

[代码]layout.xml

xmlversion="1.0"encoding="utf-8"?

>

xmlns:

android="schemas.android/apk/res/android"

android:

orientation="vertical"

android:

layout_width="fill_parent"

android:

layout_height="fill_parent">

xmlns:

android="schemas.android/apk/res/android"

android:

id="@+id/map_view"

android:

layout_width="fill_parent"

android:

layout_height="fill_parent"

android:

clickable="true"

android:

enabled="true"

android:

apiKey="API-KEY-HERE"/>

[代码]AndroidManifest.xml

xmlversion="1.0"encoding="utf-8"?

>

android="schemas.android/apk/res/android"

package="com.javacodegeeks.android.googlemaps"

android:

versionCode="1"

android:

versionName="1.0">

icon="@drawable/icon"android:

label="@string/app_name">

name=".GMapsActivity"

android:

label="@string/app_name">

name="android.intent.action.MAIN"/>

name="android.intent.category.LAUNCHER"/>

name="com.google.android.maps"/>

name="android.permission.INTERNET"/>

[代码][Java]代码

privatevoidstartAnimationPopOut(){

LinearLayoutmyLayout=(LinearLayout)findViewById(R.id.anim_layout);

Animationanimation=AnimationUtils.loadAnimation(this,R.anim.bottom_out);

animation.setAnimationListener(newAnimationListener(){

@Override

publicvoidonAnimationStart(Animationanimation){

}

@Override

publicvoidonAnimationRepeat(Animationanimation){

}

@Override

publicvoidonAnimationEnd(Animationanimation){

}

});

myLayout.clearAnimation();

myLayout.startAnimation(animation);

}

[代码][XML]代码

xmlversion="1.0"encoding="utf-8"?

>

xmlns:

android="schemas.android/apk/res/android"

android:

interpolator="@android:

anim/accelerate_interpolator">

android:

fromYDelta="0%"

android:

toYDelta="60%"

android:

duration="700">

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销 > 金融投资

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1