mirror of
https://github.com/bspeice/itcs4180
synced 2024-12-04 13:18:16 -05:00
Initial layout and code skeleton for ImageViewer
This commit is contained in:
parent
e4dd5249b2
commit
cef01d01e0
@ -8,9 +8,44 @@
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
tools:context=".ImageViewerActivity" >
|
||||
|
||||
<TextView
|
||||
<ImageView
|
||||
android:id="@+id/imageView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hello_world" />
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnPrev"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/btnPrev"
|
||||
android:onClick="onClickPrev" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnBack"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/btnBack"
|
||||
android:onClick="onClickBack" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnNext"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/btnNext"
|
||||
android:onClick="onClickNext" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -213,4 +213,10 @@
|
||||
|
||||
<string name="hello_world">Hello world!</string>
|
||||
|
||||
<string name="btnPrev">Previous</string>
|
||||
|
||||
<string name="btnBack">Back</string>
|
||||
|
||||
<string name="btnNext">Next</string>
|
||||
|
||||
</resources>
|
@ -1,15 +1,27 @@
|
||||
package com.example.hw4;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.app.Activity;
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.Menu;
|
||||
import android.view.View;
|
||||
|
||||
public class ImageViewerActivity extends Activity {
|
||||
|
||||
int urlsId;
|
||||
String[] urls;
|
||||
int currentIndex;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_image_viewer);
|
||||
|
||||
Bundle extras = getIntent().getExtras();
|
||||
urlsId = extras.getInt("urls");
|
||||
urls = getResources().getStringArray(urlsId);
|
||||
currentIndex = extras.getInt("index");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -18,5 +30,35 @@ public class ImageViewerActivity extends Activity {
|
||||
getMenuInflater().inflate(R.menu.image_viewer, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onClickPrev(View v) {
|
||||
|
||||
}
|
||||
|
||||
public void onClickNext(View v) {
|
||||
|
||||
}
|
||||
|
||||
public void onClickBack(View v) {
|
||||
finish();
|
||||
}
|
||||
|
||||
public void displayImage(int indexToDisplay) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
private class ImageDownloader extends AsyncTask<String, Void, Bitmap> {
|
||||
@Override
|
||||
protected Bitmap doInBackground(String... params) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bitmap result) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onPostExecute(result);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user