Calculator Overlay
This commit is contained in:
parent
3dd73efaea
commit
75b60e7390
8
calculatorpp/res/layout/overlay_footer.xml
Normal file
8
calculatorpp/res/layout/overlay_footer.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
</LinearLayout>
|
22
calculatorpp/res/layout/overlay_header.xml
Normal file
22
calculatorpp/res/layout/overlay_header.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
|
||||
a:orientation="horizontal"
|
||||
a:layout_width="match_parent"
|
||||
a:layout_height="wrap_content"
|
||||
a:gravity="right">
|
||||
|
||||
<Button a:id="@+id/overlay_hide_button"
|
||||
a:layout_width="wrap_content"
|
||||
a:layout_height="wrap_content"
|
||||
style="?cpp_operation_button_style"
|
||||
a:text="_"/>
|
||||
|
||||
|
||||
<Button a:id="@+id/overlay_close_button"
|
||||
a:layout_width="wrap_content"
|
||||
a:layout_height="wrap_content"
|
||||
style="?cpp_operation_button_style"
|
||||
a:text="x"/>
|
||||
|
||||
</LinearLayout>
|
@ -4,6 +4,8 @@
|
||||
a:orientation="vertical"
|
||||
style="@style/cpp_widget_main_layout_style">
|
||||
|
||||
<include layout="@layout/overlay_header"/>
|
||||
|
||||
<include layout="@layout/widget_editor"
|
||||
a:layout_weight="2"
|
||||
a:layout_width="match_parent"
|
||||
@ -31,4 +33,6 @@
|
||||
a:layout_width="match_parent"
|
||||
a:layout_height="0dp"/>
|
||||
|
||||
<include layout="@layout/overlay_footer"/>
|
||||
|
||||
</LinearLayout>
|
@ -68,6 +68,13 @@ public class CalculatorOverlayService extends Service implements ExternalCalcula
|
||||
}
|
||||
}
|
||||
|
||||
view.findViewById(R.id.overlay_close_button).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
stopService(new Intent(getApplicationContext(), CalculatorOverlayService.class));
|
||||
}
|
||||
});
|
||||
|
||||
final WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
|
||||
wm.addView(view, params);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user