Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
improve scroll speed on bijin-tokei
  • Loading branch information
mamewotoko committed Sep 6, 2011
1 parent d1f1736 commit 7381860
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 47 deletions.
5 changes: 2 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This is a simple alarm application of android (version 2.3.3).
filename in /sdcard/music/ folder
3. Build and run on your target device


## TODO:
- editable playlist support
-- add favorite music
Expand All @@ -23,8 +22,8 @@ This is a simple alarm application of android (version 2.3.3).
- implement more smart scroll

## FUTURE WORK:
- add tweet button of now playing
- link to music store
- add "good morning" or "now playing" tweet button
- link to music store (where?)
- redesign alarm function

## APPENDIX
Expand Down
53 changes: 9 additions & 44 deletions src/com/mamewo/hello/HelloActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
import java.io.IOException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Set;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
Expand Down Expand Up @@ -59,9 +56,6 @@ public class HelloActivity extends Activity implements OnClickListener {
private TextView _time_label;
private WebView _webview;
private Vibrator _vibrator;

private static final int REQUEST_ENABLE_BT = 10;
private BluetoothAdapter _adapter;
private PhoneStateListener _calllistener;

public class MyCallListener extends PhoneStateListener{
Expand Down Expand Up @@ -132,9 +126,17 @@ public void onPageFinished(WebView view, String url) {
//TODO: get precise posiiton....
view.zoomOut();
//add sleep?
try {
//TODO: find more good solution... implement onAnimcationEnd?
Thread.sleep(500);
} catch (InterruptedException e) {

}
if(url.indexOf("binan") > 0) {
view.scrollTo(0, 300);
//TODO: fix scroll problem
view.scrollTo(0, 650);
} else {
//Log.i("Hello", "bijin");
view.scrollTo(0, 780);
}
}
Expand Down Expand Up @@ -441,41 +443,4 @@ public static void startMusic(String[] playlist) {
}
}
}

//obsoleted code...
void displayBluetoothDevices() {
Set<BluetoothDevice> devices = _adapter.getBondedDevices();
String message = "";
for (BluetoothDevice dev : devices) {
message += dev.getName() + ": " + dev.getAddress() + "\n";
}
showMessage(this.getBaseContext(), message);
}

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d("DEBUG", "onActivityResult: " + requestCode + ": " + resultCode);
if (requestCode == REQUEST_ENABLE_BT) {
if (resultCode != RESULT_OK) {
return;
}
displayBluetoothDevices();
}
}

public void discoverBluetoothDevices(View v) {
Context context = v.getContext();
_adapter = BluetoothAdapter.getDefaultAdapter();
if (_adapter == null) {
showMessage(v.getContext(), context.getString(R.string.no_bluetooth));
return;
}
showMessage(v.getContext(), context.getString(R.string.start_bluetooth));
if (!_adapter.isEnabled()) {
Intent i = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
//TODO: use id!
startActivityForResult(i, REQUEST_ENABLE_BT);
}
showMessage(context, context.getString(R.string.search_bluetooth));
displayBluetoothDevices();
}
}

0 comments on commit 7381860

Please sign in to comment.