Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fix/android-anr
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantsaini1 committed Feb 17, 2025
2 parents 6550761 + 70766c7 commit 534cdde
Show file tree
Hide file tree
Showing 14 changed files with 146 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
run: |
sudo dpkg --add-architecture i386
sudo apt-get update -y -qq
sudo apt-get install -y -qq gperf libatomic1:i386 libc6:i386 libncurses5:i386 libstdc++6:i386
sudo apt-get install -y -qq gperf libatomic1:i386 libc6:i386 libstdc++6:i386
shell: bash

- name: Setup Node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
android:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
USE_CCACHE: 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
console.log(`${process.env.vtag} does not exist so continuing`)
android:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [validate]
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
Expand Down
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
## [12.6.2](https://github.com/tidev/titanium_mobile/compare/12_6_1_GA...12.6.2) (2025-02-03)

## About this release

Titanium SDK 12.6.2 is a patch release of the SDK, addressing high-priority issues from previous releases.

As of this GA release, the previous Titanium SDK patch release (12.6.1) is no longer supported.

## Community Credits

* Michael Gangolf
* fix crash when using window.add([]) with a null object ([506bad4](https://github.com/tidev/titanium_mobile/commit/506bad4d8de3b2111daf7557ee051f648bae1905))
* make android mocha tests run again ([31ae72d](https://github.com/tidev/titanium_mobile/commit/31ae72dfc73389f7977d08a4afd5d812f42be803))
* missing null checks in Ti.UI.Label methods ([0015ff1](https://github.com/tidev/titanium_mobile/commit/0015ff1bdbc8df99b775d6355d7ac7295a099213))
* fix tableView parent ([9d419d8](https://github.com/tidev/titanium_mobile/commit/9d419d89ba92c86cb30d90c36607cada56d04fd9))
* fix path error on Windows module builds ([73e4120](https://github.com/tidev/titanium_mobile/commit/73e4120ef88e28b2435aa52c8a79d440feb28a81))
* expose uiFlags ([cbb0998](https://github.com/tidev/titanium_mobile/commit/cbb099811b6a687b78f5ec592dc024a6f6fa4b7b))

* Prashant Saini
* fix global header/footer title in ListView ([1cac525](https://github.com/tidev/titanium_mobile/commit/1cac525fef9b518e4146ef77ec73eb4fbd39db0f))

* Hans Knöchel
* restore old scons dependencies to fix local Xcode build ([14d054a](https://github.com/tidev/titanium_mobile/commit/14d054a7b09ea128ffe2917b7853e7fbbda1d14d))
* fix plist entry entry for non-existing fonts ([2cf5a8e](https://github.com/tidev/titanium_mobile/commit/2cf5a8e89cda4848111cbefae99c00036dca2069))


## Bug Fixes

### Android platform

* fix crash when using window.add([]) with a null object ([506bad4](https://github.com/tidev/titanium_mobile/commit/506bad4d8de3b2111daf7557ee051f648bae1905))
* fix global header/footer title in ListView ([1cac525](https://github.com/tidev/titanium_mobile/commit/1cac525fef9b518e4146ef77ec73eb4fbd39db0f))
* fix path error on Windows module builds ([73e4120](https://github.com/tidev/titanium_mobile/commit/73e4120ef88e28b2435aa52c8a79d440feb28a81))
* fix tableView parent ([9d419d8](https://github.com/tidev/titanium_mobile/commit/9d419d89ba92c86cb30d90c36607cada56d04fd9))
* missing null checks in Ti.UI.Label methods ([0015ff1](https://github.com/tidev/titanium_mobile/commit/0015ff1bdbc8df99b775d6355d7ac7295a099213))

### Multiple platforms

* restore old scons dependencies to fix local Xcode build ([14d054a](https://github.com/tidev/titanium_mobile/commit/14d054a7b09ea128ffe2917b7853e7fbbda1d14d))
* fix plist entry entry for non-existing fonts ([2cf5a8e](https://github.com/tidev/titanium_mobile/commit/2cf5a8e89cda4848111cbefae99c00036dca2069))
* make android mocha tests run again ([31ae72d](https://github.com/tidev/titanium_mobile/commit/31ae72dfc73389f7977d08a4afd5d812f42be803))

## Features

### Android platform

* expose uiFlags ([cbb0998](https://github.com/tidev/titanium_mobile/commit/cbb099811b6a687b78f5ec592dc024a6f6fa4b7b))


## SDK Module Versions

| Module | Android version | iOS Version |
| ----------- | --------------- | ----------- |
| facebook | 13.0.0 | 15.0.0 |
| ti.map | 5.6.1 | 7.3.1 |
| ti.webdialog | 2.3.0 | 3.0.2 |
| ti.playservices | 18.3.0 | n/a |
| ti.identity | 3.1.0 | 5.0.0 |
| urlSession | n/a | 4.0.1 |
| ti.coremotion | n/a | 4.0.1 |
| ti.applesignin | n/a | 3.1.2 |
| hyperloop | 7.0.9 | 7.0.9 |

## [12.6.1](https://github.com/tidev/titanium_mobile/compare/12_6_0_GA...12.6.1) (2024-12-19)

## About this release
Expand Down
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/phobeous"><img src="https:&#x2F;&#x2F;github.com&#x2F;phobeous.png" width="60px" alt="User avatar: Rodrigo Farfán" /></a><a href="https://github.com/de1mat"><img src="https:&#x2F;&#x2F;github.com&#x2F;de1mat.png" width="60px" alt="User avatar: Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https:&#x2F;&#x2F;github.com&#x2F;dlewis23.png" width="60px" alt="User avatar: dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https:&#x2F;&#x2F;github.com&#x2F;dethier1958.png" width="60px" alt="User avatar: Daniel Ethier" /></a><a href="https://github.com/zenjoe"><img src="https:&#x2F;&#x2F;github.com&#x2F;zenjoe.png" width="60px" alt="User avatar: Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https:&#x2F;&#x2F;github.com&#x2F;desarrollogotit.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/Astrovic"><img src="https:&#x2F;&#x2F;github.com&#x2F;Astrovic.png" width="60px" alt="User avatar: Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https:&#x2F;&#x2F;github.com&#x2F;Arood.png" width="60px" alt="User avatar: Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https:&#x2F;&#x2F;github.com&#x2F;Rearmachine.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/alexlarocca"><img src="https:&#x2F;&#x2F;github.com&#x2F;alexlarocca.png" width="60px" alt="User avatar: Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https:&#x2F;&#x2F;github.com&#x2F;reshopper.png" width="60px" alt="User avatar: Reshopper" /></a><a href="https://github.com/safadig"><img src="https:&#x2F;&#x2F;github.com&#x2F;safadig.png" width="60px" alt="User avatar: Gus" /></a><a href="https://github.com/designbymind"><img src="https:&#x2F;&#x2F;github.com&#x2F;designbymind.png" width="60px" alt="User avatar: Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https:&#x2F;&#x2F;github.com&#x2F;greatschism.png" width="60px" alt="User avatar: Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https:&#x2F;&#x2F;github.com&#x2F;enzoq.png" width="60px" alt="User avatar: Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https:&#x2F;&#x2F;github.com&#x2F;mighty-office.png" width="60px" alt="User avatar: Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https:&#x2F;&#x2F;github.com&#x2F;Fruugul.png" width="60px" alt="User avatar: Fruugul" /></a><a href="https://github.com/korelogic"><img src="https:&#x2F;&#x2F;github.com&#x2F;korelogic.png" width="60px" alt="User avatar: Korelogic Limited" /></a><a href="https://github.com/libemax"><img src="https:&#x2F;&#x2F;github.com&#x2F;libemax.png" width="60px" alt="User avatar: Libemax" /></a><a href="https://github.com/eddyinet"><img src="https:&#x2F;&#x2F;github.com&#x2F;eddyinet.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/gouldjw"><img src="https:&#x2F;&#x2F;github.com&#x2F;gouldjw.png" width="60px" alt="User avatar: John Gould" /></a><a href="https://github.com/victorpl"><img src="https:&#x2F;&#x2F;github.com&#x2F;victorpl.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/PatrickMounteney"><img src="https:&#x2F;&#x2F;github.com&#x2F;PatrickMounteney.png" width="60px" alt="User avatar: Patrick Mounteney" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/phobeous"><img src="https:&#x2F;&#x2F;github.com&#x2F;phobeous.png" width="60px" alt="User avatar: Rodrigo Farfán" /></a><a href="https://github.com/de1mat"><img src="https:&#x2F;&#x2F;github.com&#x2F;de1mat.png" width="60px" alt="User avatar: Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https:&#x2F;&#x2F;github.com&#x2F;dlewis23.png" width="60px" alt="User avatar: dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https:&#x2F;&#x2F;github.com&#x2F;dethier1958.png" width="60px" alt="User avatar: Daniel Ethier" /></a><a href="https://github.com/zenjoe"><img src="https:&#x2F;&#x2F;github.com&#x2F;zenjoe.png" width="60px" alt="User avatar: Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https:&#x2F;&#x2F;github.com&#x2F;desarrollogotit.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/Astrovic"><img src="https:&#x2F;&#x2F;github.com&#x2F;Astrovic.png" width="60px" alt="User avatar: Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https:&#x2F;&#x2F;github.com&#x2F;Arood.png" width="60px" alt="User avatar: Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https:&#x2F;&#x2F;github.com&#x2F;Rearmachine.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/alexlarocca"><img src="https:&#x2F;&#x2F;github.com&#x2F;alexlarocca.png" width="60px" alt="User avatar: Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https:&#x2F;&#x2F;github.com&#x2F;reshopper.png" width="60px" alt="User avatar: Reshopper" /></a><a href="https://github.com/safadig"><img src="https:&#x2F;&#x2F;github.com&#x2F;safadig.png" width="60px" alt="User avatar: Gus" /></a><a href="https://github.com/designbymind"><img src="https:&#x2F;&#x2F;github.com&#x2F;designbymind.png" width="60px" alt="User avatar: Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https:&#x2F;&#x2F;github.com&#x2F;greatschism.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/enzoq"><img src="https:&#x2F;&#x2F;github.com&#x2F;enzoq.png" width="60px" alt="User avatar: Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https:&#x2F;&#x2F;github.com&#x2F;mighty-office.png" width="60px" alt="User avatar: Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https:&#x2F;&#x2F;github.com&#x2F;Fruugul.png" width="60px" alt="User avatar: Fruugul" /></a><a href="https://github.com/korelogic"><img src="https:&#x2F;&#x2F;github.com&#x2F;korelogic.png" width="60px" alt="User avatar: Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https:&#x2F;&#x2F;github.com&#x2F;eddyinet.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/gouldjw"><img src="https:&#x2F;&#x2F;github.com&#x2F;gouldjw.png" width="60px" alt="User avatar: John Gould" /></a><a href="https://github.com/victorpl"><img src="https:&#x2F;&#x2F;github.com&#x2F;victorpl.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/PatrickMounteney"><img src="https:&#x2F;&#x2F;github.com&#x2F;PatrickMounteney.png" width="60px" alt="User avatar: Patrick Mounteney" /></a><a href="https://github.com/hizir"><img src="https:&#x2F;&#x2F;github.com&#x2F;hizir.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/lambus-platform"><img src="https:&#x2F;&#x2F;github.com&#x2F;lambus-platform.png" width="60px" alt="User avatar: Lambus" /></a><a href="https://github.com/emptybox"><img src="https:&#x2F;&#x2F;github.com&#x2F;emptybox.png" width="60px" alt="User avatar: Vaughn Dabney" /></a><!-- sponsors -->

## Features

Expand Down
4 changes: 2 additions & 2 deletions android/modules/ui/res/layout/titanium_ui_listview_holder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center_vertical"
android:textAlignment="viewStart"
android:minHeight="18dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
Expand All @@ -58,7 +58,7 @@
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center_vertical"
android:textAlignment="viewStart"
android:minHeight="18dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ private void appendRowInternal(Object rows, KrollDict animation, boolean interna
row.getProperties().getString(TiC.PROPERTY_FOOTER)));

// Add row to section.
row.setParent(section);
section.add(row);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,20 @@ private void updateLabelText()
public int getLineCount()
{
MaterialTextView textView = (MaterialTextView) getNativeView();
return textView.getLineCount();
if (textView != null && textView.getLayout() != null) {
return textView.getLineCount();
} else {
return 0;
}
}

public String getVisibleText()
{
MaterialTextView textView = (MaterialTextView) getNativeView();
return textView.getLayout().getText().toString();
if (textView != null && textView.getLayout() != null) {
return textView.getLayout().getText().toString();
} else {
return "";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import android.widget.ImageView;
import android.widget.TextView;

import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;

import java.lang.ref.WeakReference;
Expand All @@ -50,7 +51,7 @@ public class ListViewHolder extends TiRecyclerViewHolder<ListItemProxy>
private final TextView headerTitle;

// Middle
private final ViewGroup container;
private final ConstraintLayout container;
private final ImageView leftImage;
private final TiCompositeLayout content;
private final ImageView rightImage;
Expand All @@ -68,9 +69,6 @@ public ListViewHolder(final Context context, final ViewGroup viewGroup)

this.headerTitle = viewGroup.findViewById(R.id.titanium_ui_listview_holder_header_title);

// Header attributes.
setTitleAttributes("header", context, this.headerTitle);

this.container = viewGroup.findViewById(R.id.titanium_ui_listview_holder);

this.leftImage = viewGroup.findViewById(R.id.titanium_ui_listview_holder_left_image);
Expand All @@ -82,9 +80,6 @@ public ListViewHolder(final Context context, final ViewGroup viewGroup)
this.footer = viewGroup.findViewById(R.id.titanium_ui_listview_holder_footer);

this.footerTitle = viewGroup.findViewById(R.id.titanium_ui_listview_holder_footer_title);

// Footer attributes.
setTitleAttributes("footer", context, this.footerTitle);
}

/**
Expand Down Expand Up @@ -335,70 +330,24 @@ private void setHeaderFooter(TiViewProxy listViewProxy,
// Handle `header` and `footer`.
if (updateHeader) {
if (properties.containsKeyAndNotNull(TiC.PROPERTY_HEADER_TITLE)) {

// Handle header title.
this.headerTitle.setText(properties.getString(TiC.PROPERTY_HEADER_TITLE));
this.headerTitle.setVisibility(View.VISIBLE);
String titleText = properties.getString(TiC.PROPERTY_HEADER_TITLE);
handleHeaderFooterTitle(context, this.headerTitle, titleText, "header");

} else if (properties.containsKeyAndNotNull(TiC.PROPERTY_HEADER_VIEW)) {

// Handle header view.
final TiViewProxy headerProxy = (TiViewProxy) properties.get(TiC.PROPERTY_HEADER_VIEW);
if ((context instanceof Activity) && (headerProxy.getActivity() != context)) {
headerProxy.releaseViews();
headerProxy.setActivity((Activity) context);
}

final TiUIView view = headerProxy.getOrCreateView();
if (view != null) {
final View headerView = view.getOuterView();
if (headerView != null) {
final ViewGroup parent = (ViewGroup) headerView.getParent();
if (parent != null) {
parent.removeView(headerView);
}

// Amend maximum size for header to parent ListView measured height.
this.header.setChildFillHeight(nativeListView.getMeasuredHeight());

this.header.addView(headerView, view.getLayoutParams());
this.header.setVisibility(View.VISIBLE);
}
}
handleHeaderFooterView(context, nativeListView, this.header, headerProxy);
}
}

if (updateFooter) {
if (properties.containsKeyAndNotNull(TiC.PROPERTY_FOOTER_TITLE)) {

// Handle footer title.
this.footerTitle.setText(properties.getString(TiC.PROPERTY_FOOTER_TITLE));
this.footerTitle.setVisibility(View.VISIBLE);
String titleText = properties.getString(TiC.PROPERTY_FOOTER_TITLE);
handleHeaderFooterTitle(context, this.footerTitle, titleText, "footer");

} else if (properties.containsKeyAndNotNull(TiC.PROPERTY_FOOTER_VIEW)) {

// Handle footer view.
final TiViewProxy footerProxy = (TiViewProxy) properties.get(TiC.PROPERTY_FOOTER_VIEW);
if ((context instanceof Activity) && (footerProxy.getActivity() != context)) {
footerProxy.releaseViews();
footerProxy.setActivity((Activity) context);
}

final TiUIView view = footerProxy.getOrCreateView();
if (view != null) {
final View footerView = view.getOuterView();
if (footerView != null) {
final ViewGroup parent = (ViewGroup) footerView.getParent();
if (parent != null) {
parent.removeView(footerView);
}

// Amend maximum size for footer to parent ListView measured height.
this.footer.setChildFillHeight(nativeListView.getMeasuredHeight());

this.footer.addView(footerView, view.getLayoutParams());
this.footer.setVisibility(View.VISIBLE);
}
}
handleHeaderFooterView(context, nativeListView, this.footer, footerProxy);
}
}
}
Expand Down Expand Up @@ -494,4 +443,48 @@ private void setTitleAttributes(final String prefix, final Context context, fina
title.setBackgroundColor(COLOR_GRAY);
}
}

private void handleHeaderFooterTitle(Context context, TextView textView, CharSequence text, String themePrefix)
{
// Set attributes.
setTitleAttributes(themePrefix, context, textView);

// Handle title.
textView.setText(text);
textView.setVisibility(View.VISIBLE);

// Reset layout params to trigger layout update.
this.container.setLayoutParams(new ConstraintLayout.LayoutParams(
ConstraintLayout.LayoutParams.MATCH_PARENT,
ConstraintLayout.LayoutParams.WRAP_CONTENT
));
}

private void handleHeaderFooterView(
Context context,
View nativeListView,
TiCompositeLayout viewContainer,
TiViewProxy headerOrFooterViewProxy)
{
if ((context instanceof Activity) && (headerOrFooterViewProxy.getActivity() != context)) {
headerOrFooterViewProxy.releaseViews();
headerOrFooterViewProxy.setActivity((Activity) context);
}

final TiUIView view = headerOrFooterViewProxy.getOrCreateView();
if (view != null) {
final View headerOrFooterView = view.getOuterView();
if (headerOrFooterView != null) {
final ViewGroup parent = (ViewGroup) headerOrFooterView.getParent();
if (parent != null) {
parent.removeView(headerOrFooterView);
}

// Amend maximum size for header to parent ListView measured height.
viewContainer.setChildFillHeight(nativeListView.getMeasuredHeight());
viewContainer.addView(headerOrFooterView, view.getLayoutParams());
viewContainer.setVisibility(View.VISIBLE);
}
}
}
}
2 changes: 1 addition & 1 deletion android/templates/module/generated/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ tasks.withType(JavaCompile).configureEach {
environment 'TI_MODULE_GENERATED_JS_DIR', "${projectDir}/build/ti-generated/js"
environment 'TI_MODULE_ID', '<%- moduleId %>'
environment 'TI_MODULE_NAMESPACE', '<%- moduleId.toLowerCase() %>'
environment 'TI_MODULE_TEMPLATE_DIR', '<%- tiSdkModuleTemplateDir.replace(/\\/g, ' \ \ \ \ ') %>'
environment 'TI_MODULE_TEMPLATE_DIR', '<%- tiSdkModuleTemplateDir.replace(/\\/g, '\\\\') %>'
executable = 'node'
workingDir = projectDir
args = ['generate-cpp-files.js']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,11 @@ public void add(Object args)
if (arg instanceof TiViewProxy) {
add((TiViewProxy) arg);
} else {
Log.w(TAG, "add() unsupported array object: " + arg.getClass().getSimpleName());
if (arg == null) {
Log.w(TAG, "add() unsupported array object: null");
} else {
Log.w(TAG, "add() unsupported array object: " + arg.getClass().getSimpleName());
}
}
}
} else if (args instanceof TiViewProxy) {
Expand Down
Loading

0 comments on commit 534cdde

Please sign in to comment.