import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
-import android.view.View.OnLongClickListener;
import android.widget.ImageButton;
import android.widget.Toast;
img.setOnClickListener(this);
img = (ImageButton)findViewById(R.id.play);
img.setOnClickListener(this);
+ img = (ImageButton)findViewById(R.id.rplay);
+ img.setOnClickListener(this);
img = (ImageButton)findViewById(R.id.suspend);
img.setOnClickListener(this);
public void onClick(View v) {
if (v instanceof ImageButton) {
int id = ((ImageButton)v).getId();
- if (id == R.id.button0) { send("key 0"); }
+ if (id == R.id.stop) { send("stop"); }
+ else if (id == R.id.play) { send("play"); }
+ else if (id == R.id.rplay) { send("rplay"); }
+ else if (id == R.id.button0) { send("key 0"); }
else if (id == R.id.button1) { send("key 1"); }
else if (id == R.id.button2) { send("key 2"); }
else if (id == R.id.button3) { send("key 3"); }
else if (id == R.id.media_dn) { send("media_dn"); }
else if (id == R.id.slow_rt) { send("slow_rt"); }
else if (id == R.id.full_scr) { send("key F"); }
- else if (id == R.id.stop) { send("stop"); }
- else if (id == R.id.play) { send("play"); }
else {
save_defaults();
if (id == R.id.config) {
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content">
<ImageButton
android:id="@+id/button0"
</LinearLayout>
<LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent" >
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<ImageButton
android:id="@+id/button5"
</LinearLayout>
<LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent" >
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<ImageButton
android:id="@+id/buttonA"
</LinearLayout>
<LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent" >
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<ImageButton
android:id="@+id/buttonF"
android:cropToPadding="false"
android:scaleType="fitXY"
android:src="@mipmap/zfigdot" />
- </LinearLayout>
+
+ <ImageButton
+ android:id="@+id/full_scr"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:adjustViewBounds="true"
+ android:cropToPadding="false"
+ android:scaleType="fitXY"
+ android:src="@mipmap/full_scr" />
+
+ <ImageButton
+ android:id="@+id/power"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:adjustViewBounds="true"
+ android:cropToPadding="false"
+ android:scaleType="fitXY"
+ android:src="@mipmap/power" />
+
+ <ImageButton
+ android:id="@+id/exit"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:adjustViewBounds="true"
+ android:cropToPadding="false"
+ android:scaleType="fitXY"
+ android:src="@mipmap/exit" />
+ </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal">
<ImageButton
android:id="@+id/fast_lt"
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal">
<ImageButton
android:id="@+id/media_lt"
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal">
<ImageButton
android:id="@+id/slow_lt"
android:cropToPadding="false"
android:scaleType="fitXY"
android:src="@mipmap/config" />
- </LinearLayout>
+ </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal">
<ImageButton
- android:id="@+id/full_scr"
+ android:id="@+id/rplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:cropToPadding="false"
android:scaleType="fitXY"
- android:src="@mipmap/full_scr" />
+ android:src="@mipmap/rev" />
<ImageButton
android:id="@+id/stop"
android:cropToPadding="false"
android:scaleType="fitXY"
android:src="@mipmap/play" />
-
- <ImageButton
- android:id="@+id/exit"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:adjustViewBounds="true"
- android:cropToPadding="false"
- android:scaleType="fitXY"
- android:src="@mipmap/exit" />
-
- <ImageButton
- android:id="@+id/power"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:adjustViewBounds="true"
- android:cropToPadding="false"
- android:scaleType="fitXY"
- android:src="@mipmap/power" />
</LinearLayout>
</LinearLayout>
case '0': case '9':
position = length * (key-'0')/10.0;
break;
- case UP: position += 60.0; break;
- case DOWN: position -= 60.0; break;
- case LEFT: position -= 10.0; break;
- case RIGHT: position += 10.0; break;
- case KPPLAY: next_command = NORMAL_FWD; break;
- case KPSTOP: next_command = STOP; break;
- case KPBACK: next_command = FAST_REWIND; break;
- case KPFWRD: next_command = FAST_FWD; break;
- case KPRECD: next_command = SLOW_REWIND; break;
- case KPAUSE: next_command = SLOW_FWD; break;
- case ' ': next_command = NORMAL_FWD; break;
- case 'a': gui->tile_windows(0); return 1;
- case 'b': gui->tile_windows(1); return 1;
- case 'c': gui->tile_windows(2); return 1;
+ case UP: position += 60.0; break;
+ case DOWN: position -= 60.0; break;
+ case LEFT: position -= 10.0; break;
+ case RIGHT: position += 10.0; break;
+ case KPSTOP: next_command = STOP; break;
+ case KPREV: next_command = NORMAL_REWIND; break;
+ case KPPLAY: next_command = NORMAL_FWD; break;
+ case KPBACK: next_command = FAST_REWIND; break;
+ case KPFWRD: next_command = FAST_FWD; break;
+ case KPRECD: next_command = SLOW_REWIND; break;
+ case KPAUSE: next_command = SLOW_FWD; break;
+ case ' ': next_command = NORMAL_FWD; break;
+ case 'a': gui->tile_windows(0); return 1;
+ case 'b': gui->tile_windows(1); return 1;
+ case 'c': gui->tile_windows(2); return 1;
case 'd':
mwindow_gui->channel_info->toggle_scan();
return 1;