Skip to content

Commit

Permalink
Merge branch 'master' into androidStatusBarColor
Browse files Browse the repository at this point in the history
  • Loading branch information
cb1kenobi authored Sep 13, 2024
2 parents c16ca4f + f3676e1 commit 1e4f40d
Show file tree
Hide file tree
Showing 20 changed files with 238 additions and 162 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ today and benefit from 1:1 sessions with the core team, exclusive modules, merch

Learn more about sponsoring TiDev, the organization behind the Titanium SDK, [here](https://github.com/sponsors/tidev) 🚀.

<!-- sponsors --><a href="https://github.com/Topener"><img src="https://github.com/Topener.png" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https://github.com/phobeous.png" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/jasonkneen"><img src="https://github.com/jasonkneen.png" width="60px" alt="Jason Kneen" /></a><a href="https://github.com/de1mat"><img src="https://github.com/de1mat.png" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https://github.com/dlewis23.png" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https://github.com/dethier1958.png" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/zenjoe"><img src="https://github.com/zenjoe.png" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https://github.com/desarrollogotit.png" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https://github.com/Astrovic.png" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https://github.com/Arood.png" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https://github.com/Rearmachine.png" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https://github.com/alexlarocca.png" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https://github.com/reshopper.png" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https://github.com/safadig.png" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https://github.com/designbymind.png" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https://github.com/greatschism.png" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https://github.com/enzoq.png" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https://github.com/mighty-office.png" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https://github.com/Fruugul.png" width="60px" alt="Fruugul" /></a><a href="https://github.com/korelogic"><img src="https://github.com/korelogic.png" width="60px" alt="Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https://github.com/eddyinet.png" width="60px" alt="" /></a><a href="https://github.com/gouldjw"><img src="https://github.com/gouldjw.png" width="60px" alt="John Gould" /></a><a href="https://github.com/Yackens"><img src="https://github.com/Yackens.png" width="60px" alt="Joaquin Maroto" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/Topener"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1898949?u&#x3D;2a4679d6ddcec38e0e8855796b6df883b05ca295&amp;v&#x3D;4" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;5816606?u&#x3D;129b37486ffa01feb669bf7ad8adc3c81a305f0b&amp;v&#x3D;4" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/de1mat"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;901045?u&#x3D;7c5bd52413a071a9d5f6c9f8c0dab6c299e62f15&amp;v&#x3D;4" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8171849?u&#x3D;990e64ef4c1909a0b0e8924c4e6c5b3f730b260b&amp;v&#x3D;4" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;6359232?u&#x3D;7a635b5d99fde2573103a7d94464ac3166fadad8&amp;v&#x3D;4" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/zenjoe"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;2934870?u&#x3D;0258c5d071fe0d398155ab92b5bb45c5d44fb9ef&amp;v&#x3D;4" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;104650443?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;2573811?u&#x3D;90b858430c052de19099b336344bfd6f44eb9e8a&amp;v&#x3D;4" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;81745?v&#x3D;4" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;94473234?u&#x3D;c0cfd7677bb6864e3814261f035307c834d074c1&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8946160?u&#x3D;90bd7d922f63690651f0a077ec9e862c0778e872&amp;v&#x3D;4" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;77621597?v&#x3D;4" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;5295258?u&#x3D;741e21b15806caa959e3a5fe6a580303794e047b&amp;v&#x3D;4" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;874832?u&#x3D;51f1e316e60d21f9d8dce3ccf69056a6209b1a71&amp;v&#x3D;4" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1700582?u&#x3D;3ff22598878dc903595a6b6b541de33ad45bd918&amp;v&#x3D;4" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;7572148?u&#x3D;ff1828727f6afc13559f79dcb7bf505629e17e1f&amp;v&#x3D;4" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;11294684?v&#x3D;4" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;71382335?u&#x3D;d488db216612dbff622368a3ab7016bb083badee&amp;v&#x3D;4" width="60px" alt="Fruugul" /></a><a href="https://github.com/korelogic"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;306669?v&#x3D;4" width="60px" alt="Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8219203?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/gouldjw"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1489502?u&#x3D;81e9e9df9a35acf9b602126480cc5e70ead1f7a7&amp;v&#x3D;4" width="60px" alt="John Gould" /></a><a href="https://github.com/Yackens"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;58727874?v&#x3D;4" width="60px" alt="Joaquin Maroto" /></a><!-- sponsors -->

## Features

Expand Down
8 changes: 4 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ android {
// Checks our Java code against our style guidelines and for common coding mistakes using "checkstyle.xml".
// Will trigger a build failure if any violations have been detected.
// Customize all the Checkstyle tasks
tasks.withType(Checkstyle) {
tasks.withType(Checkstyle).configureEach {
// Specify all files that should be checked
classpath = files()
source android.sourceSets.main.java.srcDirs
}
// Execute Checkstyle on all files
task checkJavaStyle(type: Checkstyle) {
tasks.register('checkJavaStyle', Checkstyle) {
// include '**/*.java'
}
// Execute Checkstyle on all modified files
task checkstyleChanged(type: Checkstyle) {
tasks.register('checkstyleChanged', Checkstyle) {
include getChangedFiles()
}

Expand All @@ -73,7 +73,7 @@ def getChangedFiles() {
files
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
dependsOn checkJavaStyle
}

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ allprojects {
project.apply from: "${rootDir}/templates/build/ti.constants.gradle"
}

task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}
8 changes: 4 additions & 4 deletions android/kroll-apt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ targetCompatibility = JavaVersion.VERSION_11
// Checks our Java code against our style guidelines and for common coding mistakes using "checkstyle.xml".
// Will trigger a build failure if any violations have been detected.
// Customize all the Checkstyle tasks
tasks.withType(Checkstyle) {
tasks.withType(Checkstyle).configureEach {
// Specify all files that should be checked
classpath = files()
source 'src/main/java'
}
// Execute Checkstyle on all files
task checkJavaStyle(type: Checkstyle) {
tasks.register('checkJavaStyle', Checkstyle) {
// include '**/*.java'
}
task checkstyleChanged(type: Checkstyle) {
tasks.register('checkstyleChanged', Checkstyle) {
include getChangedFiles()
}

Expand All @@ -47,7 +47,7 @@ def getChangedFiles() {
}

// Hook into Java compile task.
tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
// Check Java code for mistakes before compiling.
dependsOn checkJavaStyle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ public class MediaModule extends KrollModule implements Handler.Callback
private static String mediaType = MEDIA_TYPE_PHOTO;
private static ContentResolver contentResolver;
private boolean useCameraX = false;
private static boolean pathOnly = false;

public MediaModule()
{
Expand Down Expand Up @@ -1116,6 +1117,15 @@ public void openPhotoGallery(KrollDict options)
TiIntentWrapper galleryIntent = new TiIntentWrapper(new Intent());
galleryIntent.getIntent().setAction(Intent.ACTION_GET_CONTENT);

if (options.containsKeyAndNotNull(TiC.PROPERTY_MAX_IMAGES)
&& options.containsKey(TiC.PROPERTY_ALLOW_MULTIPLE)
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
// set max image count
galleryIntent = new TiIntentWrapper(new Intent(MediaStore.ACTION_PICK_IMAGES));
galleryIntent.getIntent()
.putExtra(MediaStore.EXTRA_PICK_IMAGES_MAX, options.getInt(TiC.PROPERTY_MAX_IMAGES));
}

boolean isSelectingPhoto = false;
boolean isSelectingVideo = false;
if (options.containsKey(TiC.PROPERTY_MEDIA_TYPES)) {
Expand Down Expand Up @@ -1163,6 +1173,11 @@ public void openPhotoGallery(KrollDict options)
galleryIntent.getIntent().putExtra(Intent.EXTRA_ALLOW_MULTIPLE, allowMultiple);
}

pathOnly = false;
if (options.containsKeyAndNotNull(TiC.PROPERTY_PATH_ONLY)) {
pathOnly = options.getBoolean(TiC.PROPERTY_PATH_ONLY);
}

final int code = allowMultiple ? PICK_IMAGE_MULTIPLE : PICK_IMAGE_SINGLE;

activitySupport.launchActivityForResult(galleryIntent.getIntent(), code, new TiActivityResultHandler() {
Expand Down Expand Up @@ -1401,16 +1416,18 @@ protected static KrollDict createDictForImage(TiBlob imageData, String mimeType)
d.put("width", width);
d.put("height", height);

// Add the image/video's crop dimensiosn to the dictionary.
// Add the image/video's crop dimension to the dictionary.
KrollDict cropRect = new KrollDict();
cropRect.put("x", 0);
cropRect.put("y", 0);
cropRect.put("width", width);
cropRect.put("height", height);
d.put("cropRect", cropRect);

d.put("path", imageData.getNativePath());
// Add the blob to the dictionary.
d.put("media", imageData);
if (!pathOnly) {
d.put("media", imageData);
}
return d;
}

Expand Down
167 changes: 81 additions & 86 deletions android/modules/ui/res/layout/titanium_ui_listview_holder.xml
Original file line number Diff line number Diff line change
@@ -1,96 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/titanium_ui_listview_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:outlineProvider="bounds">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/titanium_ui_listview_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:outlineProvider="bounds">

<!-- Header Container -->
<RelativeLayout
android:id="@+id/titanium_ui_listview_holder_header_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<org.appcelerator.titanium.view.TiCompositeLayout
android:id="@+id/titanium_ui_listview_holder_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:addStatesFromChildren="true"
app:layout_constraintBottom_toTopOf="@+id/titanium_ui_listview_holder_footer_title"
app:layout_constraintStart_toEndOf="@id/titanium_ui_listview_holder_left_image"
app:layout_constraintTop_toBottomOf="@+id/titanium_ui_listview_holder_header_title" />

<org.appcelerator.titanium.view.TiCompositeLayout
android:id="@+id/titanium_ui_listview_holder_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"/>
<TextView
android:id="@+id/titanium_ui_listview_holder_header_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="18dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:gravity="center_vertical"
android:focusable="false"
android:focusableInTouchMode="false"/>
</RelativeLayout>
<ImageView
android:id="@+id/titanium_ui_listview_holder_left_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:paddingStart="6dp"
android:paddingEnd="0dp"
app:layout_constraintBottom_toTopOf="@id/titanium_ui_listview_holder_footer_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/titanium_ui_listview_holder_header_title" />

<!-- Outer Content Container -->
<RelativeLayout
android:id="@+id/titanium_ui_listview_holder_outer_content_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/titanium_ui_listview_holder_header_container"
android:addStatesFromChildren="true">
<ImageView
android:id="@+id/titanium_ui_listview_holder_right_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintBottom_toBottomOf="@id/titanium_ui_listview_holder_footer_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/titanium_ui_listview_holder_header_title" />

<ImageView
android:id="@+id/titanium_ui_listview_holder_left_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="6dp"
android:focusable="false"
android:focusableInTouchMode="false"/>
<TextView
android:id="@+id/titanium_ui_listview_holder_header_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center_vertical"
android:minHeight="18dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<org.appcelerator.titanium.view.TiCompositeLayout
android:id="@+id/titanium_ui_listview_holder_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/titanium_ui_listview_holder_left_image"
android:addStatesFromChildren="true"/>
<TextView
android:id="@+id/titanium_ui_listview_holder_footer_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center_vertical"
android:minHeight="18dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<ImageView
android:id="@+id/titanium_ui_listview_holder_right_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="6dp"
android:focusable="false"
android:focusableInTouchMode="false"/>

</RelativeLayout>
<org.appcelerator.titanium.view.TiCompositeLayout
android:id="@+id/titanium_ui_listview_holder_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!-- Footer Container -->
<RelativeLayout
android:id="@+id/titanium_ui_listview_holder_footer_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@id/titanium_ui_listview_holder_outer_content_container">
<org.appcelerator.titanium.view.TiCompositeLayout
android:id="@+id/titanium_ui_listview_holder_footer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<org.appcelerator.titanium.view.TiCompositeLayout
android:id="@+id/titanium_ui_listview_holder_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"/>
<TextView
android:id="@+id/titanium_ui_listview_holder_footer_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="18dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:gravity="center_vertical"
android:focusable="false"
android:focusableInTouchMode="false" />
</RelativeLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Loading

0 comments on commit 1e4f40d

Please sign in to comment.