aboutsummaryrefslogtreecommitdiffstats
path: root/examples/platforms/android/qtquickview_java
diff options
context:
space:
mode:
authorPetri Virkkunen <petri.virkkunen@qt.io>2024-11-26 13:29:36 +0200
committerPetri Virkkunen <petri.virkkunen@qt.io>2024-12-10 10:12:24 +0200
commit8b6905704eaba702cd337c99f0845ba748f73ffb (patch)
tree47858b6b0e466463b584036faeacca73b2cc8b19 /examples/platforms/android/qtquickview_java
parentddb05b4cc61075ad2a4ffbc05c806dcf28530ae9 (diff)
QtQuickView: Modify multi-view examples to have both views visible at once
Since we now support having multiple QtQuickViews loaded at once, it was decided that we can modify the existing 1-view, content-switching examples to instead display the available QML views all at once. This change includes: - Necessary QML changes to fit the content onto one view, including text wrapping and anchoring changes - Android layout changes to add a second layout for the second QtQuickView - Source changes to load the second view, rename variables to match the new functionality, and handle orientation changes. Task-number: QTBUG-129288 Change-Id: I5c8c5e3de168365ead6fdbe9cfe7ad6285d4b8bf Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'examples/platforms/android/qtquickview_java')
-rw-r--r--examples/platforms/android/qtquickview_java/app/src/main/java/com/example/qtquickview_java/MainActivity.java123
-rw-r--r--examples/platforms/android/qtquickview_java/app/src/main/res/layout/activity_main.xml220
-rw-r--r--examples/platforms/android/qtquickview_java/app/src/main/res/values/dimens.xml3
-rw-r--r--examples/platforms/android/qtquickview_java/app/src/main/res/values/strings.xml12
4 files changed, 134 insertions, 224 deletions
diff --git a/examples/platforms/android/qtquickview_java/app/src/main/java/com/example/qtquickview_java/MainActivity.java b/examples/platforms/android/qtquickview_java/app/src/main/java/com/example/qtquickview_java/MainActivity.java
index f443f7f26b..c80bb3dcd8 100644
--- a/examples/platforms/android/qtquickview_java/app/src/main/java/com/example/qtquickview_java/MainActivity.java
+++ b/examples/platforms/android/qtquickview_java/app/src/main/java/com/example/qtquickview_java/MainActivity.java
@@ -10,11 +10,11 @@ import android.graphics.Color;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
-import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
import android.widget.TextView;
import org.qtproject.qt.android.QtQmlStatus;
import org.qtproject.qt.android.QtQmlStatusChangeListener;
@@ -38,17 +38,19 @@ public class MainActivity extends AppCompatActivity implements QtQmlStatusChange
}};
private int m_qmlButtonSignalListenerId;
private LinearLayout m_mainLinear;
- private FrameLayout m_qmlFrameLayout;
- private QtQuickView m_qtQuickView;
+
+ private FrameLayout m_firstQmlFrameLayout;
+ private FrameLayout m_secondQmlFrameLayout;
+
//! [qmlContent]
- private final Main m_mainQmlContent = new Main();
+ private final Main m_firstQmlContent = new Main();
private final Second m_secondQmlContent = new Second();
//! [qmlContent]
- private LinearLayout m_androidControlsLayout;
- private TextView m_getPropertyValueText;
+ private RelativeLayout m_androidControlsLayout;
+ private TextView m_qmlViewBackgroundText;
private TextView m_qmlStatus;
private SwitchCompat m_switch;
- private View m_box;
+ private RelativeLayout m_colorBox;
//! [onCreate]
@Override
@@ -57,46 +59,46 @@ public class MainActivity extends AppCompatActivity implements QtQmlStatusChange
setContentView(R.layout.activity_main);
m_mainLinear = findViewById(R.id.mainLinear);
- m_getPropertyValueText = findViewById(R.id.getPropertyValueText);
+ m_qmlViewBackgroundText = findViewById(R.id.qmlViewBackgroundText);
m_qmlStatus = findViewById(R.id.qmlStatusText);
- m_androidControlsLayout = findViewById(R.id.javaLinear);
- m_box = findViewById(R.id.qmlColorBox);
+ m_androidControlsLayout = findViewById(R.id.javaRelative);
+ m_colorBox = findViewById(R.id.qmlColorBox);
m_switch = findViewById(R.id.disconnectQmlListenerSwitch);
m_switch.setOnClickListener(view -> switchListener());
//! [m_qtQuickView]
- m_qtQuickView = new QtQuickView(this);
+ QtQuickView m_firstQuickView = new QtQuickView(this);
+ QtQuickView m_secondQuickView = new QtQuickView(this);
//! [m_qtQuickView]
// Set status change listener for m_qmlView
// listener implemented below in OnStatusChanged
//! [setStatusChangeListener]
- m_mainQmlContent.setStatusChangeListener(this);
+ m_firstQmlContent.setStatusChangeListener(this);
m_secondQmlContent.setStatusChangeListener(this);
//! [setStatusChangeListener]
//! [layoutParams]
- ViewGroup.LayoutParams params = new FrameLayout.LayoutParams(
+ final ViewGroup.LayoutParams params = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
- m_qmlFrameLayout = findViewById(R.id.qmlFrame);
- m_qmlFrameLayout.addView(m_qtQuickView, params);
+ m_firstQmlFrameLayout = findViewById(R.id.firstQmlFrame);
+ m_firstQmlFrameLayout.addView(m_firstQuickView, params);
+ m_secondQmlFrameLayout = findViewById(R.id.secondQmlFrame);
+ m_secondQmlFrameLayout.addView(m_secondQuickView, params);
//! [layoutParams]
//! [loadContent]
- m_qtQuickView.loadContent(m_mainQmlContent);
+ m_firstQuickView.loadContent(m_firstQmlContent);
+ m_secondQuickView.loadContent(m_secondQmlContent);
//! [loadContent]
Button m_changeColorButton = findViewById(R.id.changeQmlColorButton);
m_changeColorButton.setOnClickListener(view -> onClickListener());
- Button m_loadMainQmlButton = findViewById(R.id.loadMainQml);
- m_loadMainQmlButton.setOnClickListener(view -> loadMainQml());
- Button m_loadSecondQmlButton = findViewById(R.id.loadSecondQml);
- m_loadSecondQmlButton.setOnClickListener(view -> loadSecondQml());
Button m_rotateQmlGridButton = findViewById(R.id.rotateQmlGridButton);
m_rotateQmlGridButton.setOnClickListener(view -> rotateQmlGrid());
// Check target device orientation on launch
handleOrientationChanges();
}
-
//! [onCreate]
+
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
@@ -108,23 +110,30 @@ public class MainActivity extends AppCompatActivity implements QtQmlStatusChange
// android:configChanges) change, get display metrics and make needed changes to UI
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
- ViewGroup.LayoutParams qmlFrameLayoutParams = m_qmlFrameLayout.getLayoutParams();
+ ViewGroup.LayoutParams firstQmlFrameLayoutParams = m_firstQmlFrameLayout.getLayoutParams();
+ ViewGroup.LayoutParams secondQmlFrameLayoutParams =
+ m_secondQmlFrameLayout.getLayoutParams();
ViewGroup.LayoutParams linearLayoutParams = m_androidControlsLayout.getLayoutParams();
if (displayMetrics.heightPixels > displayMetrics.widthPixels) {
m_mainLinear.setOrientation(LinearLayout.VERTICAL);
- qmlFrameLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
- qmlFrameLayoutParams.height = 0;
+ firstQmlFrameLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ firstQmlFrameLayoutParams.height = 0;
+ secondQmlFrameLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ secondQmlFrameLayoutParams.height = 0;
linearLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
linearLayoutParams.height = 0;
} else {
m_mainLinear.setOrientation(LinearLayout.HORIZONTAL);
- qmlFrameLayoutParams.width = 0;
- qmlFrameLayoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
+ firstQmlFrameLayoutParams.width = 0;
+ firstQmlFrameLayoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
+ secondQmlFrameLayoutParams.width = 0;
+ secondQmlFrameLayoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
linearLayoutParams.width = 0;
linearLayoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
}
- m_qmlFrameLayout.setLayoutParams(qmlFrameLayoutParams);
+ m_firstQmlFrameLayout.setLayoutParams(firstQmlFrameLayoutParams);
+ m_secondQmlFrameLayout.setLayoutParams(secondQmlFrameLayoutParams);
m_androidControlsLayout.setLayoutParams(linearLayoutParams);
}
@@ -132,40 +141,36 @@ public class MainActivity extends AppCompatActivity implements QtQmlStatusChange
public void onClickListener() {
// Set the QML view root object property "colorStringFormat" value to
// color from Colors.getColor()
- m_mainQmlContent.setColorStringFormat(m_colors.getColor());
-
- String qmlBackgroundColor = m_mainQmlContent.getColorStringFormat();
+ m_firstQmlContent.setColorStringFormat(m_colors.getColor());
+ updateColorDisplay();
+ }
+ private void updateColorDisplay() {
+ String qmlBackgroundColor = m_firstQmlContent.getColorStringFormat();
// Display the QML View background color code
- m_getPropertyValueText.setText(qmlBackgroundColor);
+ m_qmlViewBackgroundText.setText(qmlBackgroundColor);
// Display the QML View background color in a view
// if qmlBackGroundColor is not null
if (qmlBackgroundColor != null) {
- m_box.setBackgroundColor(Color.parseColor(qmlBackgroundColor));
+ m_colorBox.setBackgroundColor(Color.parseColor(qmlBackgroundColor));
}
}
//! [onClickListener]
public void switchListener() {
- TextView text = findViewById(R.id.switchText);
// Disconnect QML button signal listener if switch is On using the saved signal listener Id
// and connect it again if switch is turned off
if (m_switch.isChecked()) {
- Log.i(TAG, "QML button onClicked signal listener disconnected");
- text.setText(R.string.connect_qml_button_signal_listener);
- //! [disconnect qml signal listener]
- m_mainQmlContent.disconnectSignalListener(m_qmlButtonSignalListenerId);
- //! [disconnect qml signal listener]
- } else {
- Log.i(TAG, "QML button onClicked signal listener connected");
- text.setText(R.string.disconnect_qml_button_signal_listener);
- m_qmlButtonSignalListenerId = m_mainQmlContent.connectOnClickedListener(
- (String name, Void v) -> {
- Log.i(TAG, "QML button clicked");
+ m_qmlButtonSignalListenerId =
+ m_firstQmlContent.connectOnClickedListener((String name, Void v) -> {
m_androidControlsLayout.setBackgroundColor(Color.parseColor(
m_colors.getColor()
));
});
+ } else {
+ //! [disconnect qml signal listener]
+ m_firstQmlContent.disconnectSignalListener(m_qmlButtonSignalListenerId);
+ //! [disconnect qml signal listener]
}
}
@@ -174,45 +179,25 @@ public class MainActivity extends AppCompatActivity implements QtQmlStatusChange
public void onStatusChanged(QtQmlStatus qtQmlStatus) {
Log.i(TAG, "Status of QtQuickView: " + qtQmlStatus);
- final String qmlStatus = getResources().getString(R.string.qml_view_status)
- + m_statusNames.get(qtQmlStatus);
-
// Show current QML View status in a textview
- m_qmlStatus.setText(qmlStatus);
+ m_qmlStatus.setText(getString(R.string.qml_view_status, m_statusNames.get(qtQmlStatus)));
+ updateColorDisplay();
// Connect signal listener to "onClicked" signal from main.qml
// addSignalListener returns int which can be used later to identify the listener
//! [qml signal listener]
- if (qtQmlStatus == QtQmlStatus.READY && !m_switch.isChecked()) {
- m_qmlButtonSignalListenerId = m_mainQmlContent.connectOnClickedListener(
- (String name, Void v) -> {
+ if (qtQmlStatus == QtQmlStatus.READY && m_switch.isChecked()) {
+ m_qmlButtonSignalListenerId =
+ m_firstQmlContent.connectOnClickedListener((String name, Void v) -> {
Log.i(TAG, "QML button clicked");
m_androidControlsLayout.setBackgroundColor(Color.parseColor(
m_colors.getColor()
));
});
-
}
//! [qml signal listener]
}
//! [onStatusChanged]
- //! [switchLoadedContent]
- private void loadSecondQml() {
- m_qtQuickView.loadContent(m_secondQmlContent);
-
- // Reset box color and color text after component reload
- m_box.setBackgroundColor(Color.parseColor("#00ffffff"));
- m_getPropertyValueText.setText("");
- }
-
- private void loadMainQml() {
- m_qtQuickView.loadContent(m_mainQmlContent);
-
- // Reset box color and color text after component reload
- m_box.setBackgroundColor(Color.parseColor("#00ffffff"));
- m_getPropertyValueText.setText("");
- }
- //! [switchLoadedContent]
//! [gridRotate]
private void rotateQmlGrid() {
Integer previousGridRotation = m_secondQmlContent.getGridRotation();
diff --git a/examples/platforms/android/qtquickview_java/app/src/main/res/layout/activity_main.xml b/examples/platforms/android/qtquickview_java/app/src/main/res/layout/activity_main.xml
index bccf2749eb..fd3f2e02ce 100644
--- a/examples/platforms/android/qtquickview_java/app/src/main/res/layout/activity_main.xml
+++ b/examples/platforms/android/qtquickview_java/app/src/main/res/layout/activity_main.xml
@@ -10,163 +10,105 @@
android:baselineAligned="false">
<FrameLayout
- android:id="@+id/qmlFrame"
+ android:id="@+id/firstQmlFrame"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
+ </FrameLayout>
+ <FrameLayout
+ android:id="@+id/secondQmlFrame"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1">
</FrameLayout>
- <LinearLayout
- android:id="@+id/javaLinear"
+ <RelativeLayout
+ android:id="@+id/javaRelative"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
- android:background="@color/lilac"
- android:orientation="vertical">
-
+ android:gravity="center_vertical"
+ android:background="@color/lilac">
<TextView
- android:id="@+id/title"
+ android:id="@+id/header_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="@dimen/title_margin_top"
- android:gravity="center_horizontal"
- android:includeFontPadding="false"
+ android:layout_centerHorizontal="true"
android:text="@string/java"
android:textColor="@color/white"
- android:textSize="@dimen/title_text_size"
- android:textStyle="bold" />
+ android:textStyle="bold"
+ android:textSize="@dimen/title_text_size"/>
<TextView
android:id="@+id/qmlStatusText"
+ android:textSize="@dimen/other_text_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="@dimen/smaller_top_margin"
- android:gravity="center_horizontal"
+ android:layout_below="@+id/header_title"
+ android:layout_marginTop="25dp"
+ android:layout_centerHorizontal="true"
android:text="@string/qml_view_status"
- android:textColor="@color/white"
- android:textSize="@dimen/other_text_size"/>
+ android:textColor="@color/white"/>
<LinearLayout
- android:id="@+id/buttonAndSwitchLayout"
+ android:id="@+id/qmlColorLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:gravity="center_horizontal"
android:orientation="horizontal"
- android:layout_marginTop="@dimen/bigger_top_margin"
- android:baselineAligned="false">
+ android:layout_centerHorizontal="true"
+ android:layout_below="@id/qmlStatusText"
+ android:layout_marginTop="@dimen/layout_margins">
- <LinearLayout
- android:id="@+id/buttonLinearLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="1">
-
- <TextView
- android:id="@+id/changeColorText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:gravity="center_horizontal"
- android:maxLines="3"
- android:text="@string/change_qml_background"
- android:textColor="@color/white"
- android:textSize="@dimen/other_text_size"/>
-
- <com.google.android.material.button.MaterialButton
- android:id="@+id/changeQmlColorButton"
- android:layout_width="@dimen/change_color_button_width"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="@dimen/smaller_top_margin"
- android:text="@string/button"
- android:textSize="@dimen/other_text_size"
- app:cornerRadius="@dimen/button_corner_radius"/>
- </LinearLayout>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/white"
+ android:textSize="@dimen/other_text_size"
+ android:layout_gravity="center_vertical"
+ android:text="@string/qml_view_color_label"/>
- <LinearLayout
- android:id="@+id/switchLinearLayout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="1">
+ <RelativeLayout
+ android:id="@+id/qmlColorBox"
+ android:layout_width="@dimen/color_box_width"
+ android:layout_height="@dimen/color_box_height"
+ android:background="@color/cardview_shadow_start_color"
+ android:layout_gravity="center_vertical"
+ android:layout_marginStart="@dimen/layout_margins">
<TextView
- android:id="@+id/switchText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:gravity="center_horizontal"
- android:maxLines="3"
- android:text="@string/disconnect_qml_button_signal_listener"
- android:textColor="@color/white"
- android:textSize="@dimen/other_text_size"/>
-
- <androidx.appcompat.widget.SwitchCompat
- android:id="@+id/disconnectQmlListenerSwitch"
+ android:id="@+id/qmlViewBackgroundText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="@dimen/smaller_top_margin"
- app:showText="true"
- android:thumb="@drawable/switch_thumb"
- app:track="@drawable/switch_track"
- app:switchTextAppearance="@style/switchStyle"
- android:textOff="@string/off"
- android:textOn="@string/on" />
- </LinearLayout>
+ android:textSize="@dimen/other_text_size"
+ android:text="placeholder"
+ android:layout_centerInParent="true"
+ android:textColor="@color/white"/>
+ </RelativeLayout>
</LinearLayout>
<LinearLayout
- android:id="@+id/qmlColorLinear"
+ android:id="@+id/switchAndTextLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:gravity="center_horizontal"
- android:orientation="horizontal"
- android:layout_marginTop="@dimen/bigger_top_margin">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_weight="1">
+ android:layout_below="@+id/qmlColorLayout"
+ android:layout_marginTop="@dimen/layout_margins"
+ android:layout_centerHorizontal="true">
- <TextView
- android:id="@+id/qmlViewBackgroundText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:gravity="center_horizontal"
- android:maxLines="2"
- android:text="@string/qml_view_background_color"
- android:textColor="@color/white"
- android:textSize="@dimen/other_text_size"/>
-
- <TextView
- android:id="@+id/getPropertyValueText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:gravity="center_horizontal"
- android:textColor="@color/white"
- android:textSize="@dimen/other_text_size"/>
- </LinearLayout>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/connect_qml_button_signal_listener"
+ android:textSize="@dimen/other_text_size"
+ android:textColor="@color/white"/>
- <View
- android:id="@+id/qmlColorBox"
- android:layout_width="@dimen/color_box_width"
- android:layout_height="@dimen/color_box_height"
- android:layout_gravity="center_horizontal"
- android:background="@android:color/transparent"
- android:layout_weight="0"
- android:layout_marginStart="@dimen/color_box_margin_start"/>
+ <androidx.appcompat.widget.SwitchCompat
+ android:id="@+id/disconnectQmlListenerSwitch"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:checked="true"/>
</LinearLayout>
@@ -175,37 +117,21 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal"
- android:layout_marginTop="@dimen/bigger_top_margin">
-
- <com.google.android.material.button.MaterialButton
- android:id="@+id/loadSecondQml"
- android:layout_width="@dimen/other_buttons_width"
+ android:layout_below="@+id/switchAndTextLayout"
+ android:layout_marginTop="@dimen/layout_margins">
+ <Button
+ android:id="@+id/changeQmlColorButton"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/load_second_qml"
- android:textSize="@dimen/other_text_size"
- android:layout_marginEnd="@dimen/load_second_button_margin_end"
- app:cornerRadius="@dimen/button_corner_radius"/>
-
- <com.google.android.material.button.MaterialButton
- android:id="@+id/loadMainQml"
- android:layout_width="@dimen/other_buttons_width"
+ android:layout_gravity="center_vertical"
+ android:text="@string/change_qml_background" />
+ <Button
+ android:id="@+id/rotateQmlGridButton"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/load_main_qml"
- android:textSize="@dimen/other_text_size"
- app:cornerRadius="@dimen/button_corner_radius"/>
+ android:layout_gravity="center_vertical"
+ android:text="@string/rotate_qml_grid"
+ android:layout_marginStart="@dimen/layout_margins"/>
</LinearLayout>
- <com.google.android.material.button.MaterialButton
- android:id="@+id/rotateQmlGridButton"
- android:layout_width="@dimen/other_buttons_width"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_marginTop="@dimen/rotate_qml_grid_top_margin"
- android:text="@string/rotate_qml_grid"
- android:textSize="@dimen/other_text_size"
- app:cornerRadius="@dimen/button_corner_radius"/>
-
- </LinearLayout>
-
+ </RelativeLayout>
</LinearLayout>
diff --git a/examples/platforms/android/qtquickview_java/app/src/main/res/values/dimens.xml b/examples/platforms/android/qtquickview_java/app/src/main/res/values/dimens.xml
index 682135e52a..8e493891be 100644
--- a/examples/platforms/android/qtquickview_java/app/src/main/res/values/dimens.xml
+++ b/examples/platforms/android/qtquickview_java/app/src/main/res/values/dimens.xml
@@ -2,7 +2,7 @@
<resources>
<dimen name="title_text_size">56sp</dimen>
<dimen name="other_text_size">30sp</dimen>
- <dimen name="title_margin_top">8dp</dimen>
+ <dimen name="title_margin_top">20dp</dimen>
<dimen name="smaller_top_margin">16dp</dimen>
<dimen name="bigger_top_margin">32dp</dimen>
<dimen name="change_color_button_width">225dp</dimen>
@@ -16,4 +16,5 @@
<dimen name="switch_thumb_size">45dp</dimen>
<dimen name="switch_thumb_border">2dp</dimen>
<dimen name="switch_text_size">24sp</dimen>
+ <dimen name="layout_margins">5dp</dimen>
</resources>
diff --git a/examples/platforms/android/qtquickview_java/app/src/main/res/values/strings.xml b/examples/platforms/android/qtquickview_java/app/src/main/res/values/strings.xml
index 8e78f9f6a4..e6abf57a33 100644
--- a/examples/platforms/android/qtquickview_java/app/src/main/res/values/strings.xml
+++ b/examples/platforms/android/qtquickview_java/app/src/main/res/values/strings.xml
@@ -2,15 +2,13 @@
<string name="app_name">QtQuickView Android Java Example</string>
<string name="button">Change \n color</string>
<string name="java">Java</string>
- <string name="change_qml_background">Tap button to change QML view background color</string>
- <string name="disconnect_qml_button_signal_listener">Tap switch to disconnect QML button signal listener</string>
- <string name="connect_qml_button_signal_listener">Tap switch to connect QML button signal listener</string>
+ <string name="change_qml_background">Change QML color</string>
+ <string name="connect_qml_button_signal_listener">QML Button signal connected:</string>
<string name="on">On</string>
<string name="off">Off</string>
- <string name="qml_view_status">QML view status: </string>
- <string name="qml_view_background_color">QML view background color:</string>
- <string name="load_main_qml">Load \n Main Qml</string>
+ <string name="qml_view_status">QML view status: %s</string>
+ <string name="qml_view_background_color">QML view background color: %s</string>
<string name="rotate_qml_grid">Rotate Qml grid</string>
- <string name="load_second_qml">Load \n Second Qml</string>
+ <string name="qml_view_color_label">QML View color:</string>
</resources>