Skip to content

Commit

Permalink
Merge pull request #206 from Ugzuzg/auto-centre-top-bar
Browse files Browse the repository at this point in the history
Improve layout and put MainActivity into fullscreen
  • Loading branch information
kripper authored May 18, 2024
2 parents 84b921b + 3d4ffd5 commit 8fefb6e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
8 changes: 6 additions & 2 deletions app/src/main/java/sq/rogue/rosettadrone/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,12 @@ protected void onCreate(Bundle savedInstanceState) {
//requestWindowFeature(Window.FEATURE_NO_TITLE); // for hiding title

// Make fullscreen
//getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
//WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

setContentView(R.layout.activity_gui);

Expand Down
42 changes: 16 additions & 26 deletions app/src/main/res/layout/activity_gui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,29 +166,30 @@
</FrameLayout>


<LinearLayout
<FrameLayout
android:id="@+id/camera_set"
android:layout_width="500dp"
android:layout_width="270dp"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:orientation="horizontal"
android:gravity="end"
android:padding="12dp"
android:layout_marginTop="70dp"
android:elevation="102dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">

<dji.ux.panel.CameraSettingAdvancedPanel
android:layout_width="180dp"
android:layout_height="243dp"
android:layout_height="270dp"
android:background="@color/transparent"
android:gravity="center"
android:visibility="invisible"
tools:ignore="RtlHardcoded" />

<dji.ux.panel.CameraSettingExposurePanel
android:layout_width="180dp"
android:layout_height="263dp"
android:layout_height="270dp"
android:background="@color/transparent"
android:gravity="center"
android:visibility="invisible"
Expand All @@ -197,12 +198,13 @@
<dji.ux.widget.controls.CameraControlsWidget
android:id="@+id/CameraCapturePanel"
android:layout_width="50dp"
android:layout_height="223dp"
android:layout_height="213dp"
android:layout_gravity="top|right"
tools:ignore="RtlHardcoded" />

<!-- custom:excludeItem="ESCStatus" -->

</LinearLayout>
</FrameLayout>


<RelativeLayout
Expand All @@ -226,7 +228,7 @@
android:id="@+id/signal"
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:background="@color/dark_gray"
android:orientation="horizontal">

Expand All @@ -236,8 +238,6 @@
android:layout_height="25dp" />

<ImageView
android:layout_weight="1"
android:layout_marginTop="3dp"
android:id="@+id/dji_conn"
android:layout_width="18dp"
android:layout_height="18dp"
Expand All @@ -246,15 +246,12 @@

<TextView
android:layout_weight="1"
android:layout_marginTop="3dp"
android:layout_width="35dp"
android:layout_height="20dp"
android:text="@string/dji"
android:textColor="@color/white" />

<ImageView
android:layout_weight="1"
android:layout_marginTop="3dp"
android:id="@+id/gcs_conn"
android:layout_width="18dp"
android:layout_height="18dp"
Expand All @@ -263,15 +260,13 @@

<TextView
android:layout_weight="1"
android:layout_marginTop="3dp"
android:layout_width="35dp"
android:layout_height="20dp"
android:text="@string/gcs"
android:textColor="@color/white" />

<dji.ux.widget.FlightModeWidget
android:layout_weight="1"
android:layout_marginTop="2dp"
android:layout_width="103dp"
android:layout_height="22dp" />

Expand Down Expand Up @@ -308,33 +303,28 @@

<dji.ux.widget.ConnectionWidget
android:layout_weight="1"
android:layout_marginTop="3dp"
android:layout_width="28dp"
android:layout_height="18dp" />

<Button
android:layout_weight="1"
android:id="@+id/btn_safety"
android:layout_marginTop="2dp"
android:layout_width="25dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ic_lock_outline_secondary_24dp" />

<TextView
android:layout_weight="1"
android:layout_marginTop="3dp"
android:layout_width="25dp"
android:layout_height="20dp"
android:text="" />

<Button
android:layout_weight="1"
android:id="@+id/btn_config"
android:layout_width="25dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginTop="3dp"
android:background="@drawable/ic_settings_white_24dp"
android:onClick="showPopup" />
android:onClick="showPopup"
android:layout_marginEnd="8dp" />
</LinearLayout>


Expand Down Expand Up @@ -402,7 +392,7 @@
<Button
android:id="@+id/btn_takeoff"
android:layout_width="46dp"
android:layout_height="40dp"
android:layout_height="46dp"
android:layout_marginTop="12dp"
android:background="@drawable/quadcopter_start"
android:alpha="0.75"
Expand All @@ -413,7 +403,7 @@
<Button
android:id="@+id/btn_rth"
android:layout_width="46dp"
android:layout_height="40dp"
android:layout_height="46dp"
android:layout_marginTop="12dp"
android:background="@drawable/return_home"
android:alpha="0.75"
Expand All @@ -437,7 +427,7 @@
<Button
android:id="@+id/btn_AI_start"
android:layout_width="46dp"
android:layout_height="40dp"
android:layout_height="34.5dp"
android:layout_marginTop="12dp"
android:background="@mipmap/track_right"
android:alpha="0.75"
Expand Down

0 comments on commit 8fefb6e

Please sign in to comment.