次の機能を備えた Android 用のフォト ギャラリー アプリを作成したいと考えています。
- 「壁紙として設定」オプション
- ナビゲーション ボタン (左 - 右)
ライブ壁紙のようなものです。これをすばやく作成するのに役立つソース コードがあるかどうかを知る必要があります。
HTML5 CSS3 と PHP の知識があります (役立つ場合):)
役立つヘルプをいただければ幸いです。
次の機能を備えた Android 用のフォト ギャラリー アプリを作成したいと考えています。
ライブ壁紙のようなものです。これをすばやく作成するのに役立つソース コードがあるかどうかを知る必要があります。
HTML5 CSS3 と PHP の知識があります (役立つ場合):)
役立つヘルプをいただければ幸いです。
ライブ壁紙については、以下のリンクをご覧ください。
1) PhotoGalleryライブ壁紙
2)ギャラリー壁紙
3) Android-wallpaper-slideshow
これは、アプリの画像表示を行う方法です...
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
public class CertDisplay extends Activity {
Integer[] pics = {
R.drawable.cert1,
R.drawable.cert2,
R.drawable.cert3,
R.drawable.cert4,
R.drawable.cert5
};
ImageView imageView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.certificate);
Gallery ga = (Gallery)findViewById(R.id.Gallery01);
ga.setAdapter(new ImageAdapter(this));
}
public class ImageAdapter extends BaseAdapter {
private Context ctx;
int imageBackground;
public ImageAdapter(Context c) {
ctx = c;
TypedArray ta = obtainStyledAttributes(R.styleable.Gallery1);
imageBackground = ta.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 1);
ta.recycle();
}
@Override
public int getCount() {
return pics.length;
}
@Override
public Object getItem(int arg0) {
return arg0;
}
@Override
public long getItemId(int arg0) {
return arg0;
}
@Override
public View getView(int arg0, View arg1, ViewGroup arg2) {
ImageView iv = new ImageView(ctx);
iv.setImageResource(pics[arg0]);
iv.setScaleType(ImageView.ScaleType.FIT_XY);
//iv.setLayoutParams(new Gallery.LayoutParams(750,1020));
iv.setBackgroundResource(imageBackground);
return iv;
}
}
}