Skip to content

Commit

Permalink
Merge branch 'master' into TIMOB-28360
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaysingh-axway committed Mar 15, 2021
2 parents bca64f5 + b2e6a8d commit 6dab5a3
Show file tree
Hide file tree
Showing 21 changed files with 18,385 additions and 1,216 deletions.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
contact_links:
- name: Github Discussions
url: https://github.com/appcelerator/titanium_mobile/discussions
about: Ask a question in Github Discussions
- name: TiSlack
url: https://tislack.org
about: Talk to other Titanium developers on Slack
13 changes: 6 additions & 7 deletions .github/ISSUE_TEMPLATE/report-a-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@ about: Create a report to help us improve Titanium

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
### Describe the bug
A clear and concise description of what the bug is.
### To Reproduce
Steps to reproduce the behavior, e.g.:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
### Expected behavior
A clear and concise description of what you expected to happen.

**Environment**
### Environment
Titanium SDK version:
CLI version:

**Logs**:
### Logs
Creating a trace-log:
- CLI: `appc run - p [ios|android] -l trace`
- Studio / Atom: `Log-Level (Bottom right): Trace`
Expand Down
17 changes: 1 addition & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,7 @@ def MAINLINE_BRANCH_REGEXP = /master|next|\d+_\d_(X|\d)/ // a branch is consider
def isMainlineBranch = (env.BRANCH_NAME ==~ MAINLINE_BRANCH_REGEXP)

// Keep logs/reports/etc of last 30 builds, only keep build artifacts of last 3 builds
def buildProperties = [buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '3'))]
// For mainline branches, notify Teams channel of failures/success/not built/etc
if (isMainlineBranch) {
withCredentials([string(credentialsId: 'titanium_mobile_ms_teams_webhook', variable: 'WEBHOOK_URL')]) {
buildProperties << office365ConnectorWebhooks([[
notifyBackToNormal: true,
notifyFailure: true,
notifyNotBuilt: true,
notifyUnstable: true,
notifySuccess: true,
notifyRepeatedFailure: true,
url: "${WEBHOOK_URL}"
]])
}
}
properties(buildProperties)
properties([buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '3'))])

// These values could be changed manually on PRs/branches, but be careful we don't merge the changes in. We want this to be the default behavior for now!
// target branch of test suite to test with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
android:id="@+id/titanium_ui_listview_holder_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?attr/selectableItemBackgroundBorderless"
android:addStatesFromChildren="true"/>

<ImageView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:addStatesFromChildren="true"
android:foreground="?attr/selectableItemBackgroundBorderless">
android:addStatesFromChildren="true">

<ImageView
android:id="@+id/titanium_ui_tableview_holder_left_image"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,28 @@
propertyAccessors = {
TiC.PROPERTY_EDITABLE,
TiC.PROPERTY_EDITING,
TiC.PROPERTY_FILTER_ATTRIBUTE,
TiC.PROPERTY_FILTER_ANCHORED,
TiC.PROPERTY_FILTER_ATTRIBUTE,
TiC.PROPERTY_FILTER_CASE_INSENSITIVE,
TiC.PROPERTY_HEADER_TITLE,
TiC.PROPERTY_HEADER_VIEW,
TiC.PROPERTY_FOOTER_DIVIDERS_ENABLED,
TiC.PROPERTY_FOOTER_TITLE,
TiC.PROPERTY_FOOTER_VIEW,
TiC.PROPERTY_SEARCH,
TiC.PROPERTY_SEPARATOR_COLOR,
TiC.PROPERTY_SEPARATOR_STYLE,
TiC.PROPERTY_OVER_SCROLL_MODE,
TiC.PROPERTY_HEADER_DIVIDERS_ENABLED,
TiC.PROPERTY_HEADER_TITLE,
TiC.PROPERTY_HEADER_VIEW,
TiC.PROPERTY_MAX_CLASSNAME,
TiC.PROPERTY_MIN_ROW_HEIGHT,
TiC.PROPERTY_MOVABLE,
TiC.PROPERTY_MOVING,
TiC.PROPERTY_HEADER_DIVIDERS_ENABLED,
TiC.PROPERTY_FOOTER_DIVIDERS_ENABLED,
TiC.PROPERTY_MAX_CLASSNAME,
TiC.PROPERTY_OVER_SCROLL_MODE,
TiC.PROPERTY_REFRESH_CONTROL,
TiC.PROPERTY_SCROLLABLE,
TiC.PROPERTY_SHOW_VERTICAL_SCROLL_INDICATOR
TiC.PROPERTY_SEARCH,
TiC.PROPERTY_SEPARATOR_COLOR,
TiC.PROPERTY_SEPARATOR_STYLE,
TiC.PROPERTY_SHOW_VERTICAL_SCROLL_INDICATOR,
TiC.PROPERTY_TOUCH_FEEDBACK,
TiC.PROPERTY_TOUCH_FEEDBACK_COLOR
}
)
public class TableViewProxy extends RecyclerViewProxy
Expand All @@ -64,6 +66,7 @@ public TableViewProxy()

defaultValues.put(TiC.PROPERTY_OVER_SCROLL_MODE, 0);
defaultValues.put(TiC.PROPERTY_SCROLLABLE, true);
defaultValues.put(TiC.PROPERTY_TOUCH_FEEDBACK, true);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import android.app.Activity;
import android.view.View;

import androidx.annotation.NonNull;

import ti.modules.titanium.ui.widget.TiView;
import ti.modules.titanium.ui.widget.tableview.TableViewHolder;
import ti.modules.titanium.ui.widget.tableview.TiTableView;
Expand Down Expand Up @@ -501,5 +503,19 @@ public void setNativeView(View view)
}
super.setNativeView(view);
}

@Override
protected boolean canApplyTouchFeedback(@NonNull KrollDict props)
{
// Prevent TiUIView from overriding `touchFeedback` effect.
return false;
}

@Override
protected boolean hasBorder(KrollDict d)
{
// Always create custom background drawable.
return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import androidx.annotation.NonNull;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.titanium.TiC;
Expand Down Expand Up @@ -49,6 +51,19 @@ public TiUIListView(TiViewProxy proxy)
setNativeView(listView);
}

/**
* Determine if touchFeedback can be applied to view.
*
* @param props View's property dictionary
* @return Boolean
*/
@Override
protected boolean canApplyTouchFeedback(@NonNull KrollDict props)
{
// Ignore, handled by item.
return false;
}

/**
* Get current list view instance.
*
Expand Down Expand Up @@ -222,6 +237,15 @@ public void processProperties(KrollDict d)
@Override
public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy)
{
if (key.equals(TiC.PROPERTY_TOUCH_FEEDBACK)
|| key.equals(TiC.PROPERTY_TOUCH_FEEDBACK_COLOR)) {

// Update list items.
this.listView.update();

// Return to prevent property being handled by TiUIView.
return;
}
super.propertyChanged(key, oldValue, newValue, proxy);

processProperty(key, newValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import androidx.annotation.NonNull;

import ti.modules.titanium.ui.RefreshControlProxy;
import ti.modules.titanium.ui.SearchBarProxy;
import ti.modules.titanium.ui.TableViewProxy;
Expand Down Expand Up @@ -49,6 +51,19 @@ public TiUITableView(TiViewProxy proxy)
setNativeView(tableView);
}

/**
* Determine if touchFeedback can be applied to view.
*
* @param props View's property dictionary
* @return Boolean
*/
@Override
protected boolean canApplyTouchFeedback(@NonNull KrollDict props)
{
// Ignore, handled by row.
return false;
}

/**
* Get current table view instance.
*
Expand Down Expand Up @@ -228,6 +243,15 @@ public void processProperties(KrollDict d)
@Override
public void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy)
{
if (key.equals(TiC.PROPERTY_TOUCH_FEEDBACK)
|| key.equals(TiC.PROPERTY_TOUCH_FEEDBACK_COLOR)) {

// Update table items.
this.tableView.update();

// Return to prevent property being handled by TiUIView.
return;
}
super.propertyChanged(key, oldValue, newValue, proxy);

processProperty(key, newValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.PaintDrawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
Expand All @@ -28,6 +31,8 @@

public class ItemTouchHandler extends ItemTouchHelper.SimpleCallback
{
private static final String TAG = "ItemTouchHandler";

private TiRecyclerViewAdapter adapter;
private RecyclerViewProxy recyclerViewProxy;
private Pair<Integer, Integer> movePair = null;
Expand Down Expand Up @@ -127,10 +132,33 @@ private Drawable getBackground(TiUIView parentView, boolean ignoreTransparent)
while (parentNativeView != null && parentBackground == null) {
parentBackground = parentNativeView.getBackground();

if (parentBackground instanceof RippleDrawable) {
final RippleDrawable rippleDrawable = (RippleDrawable) parentBackground;

if (rippleDrawable.getNumberOfLayers() > 0) {
final Drawable drawable = rippleDrawable.getDrawable(0);

// Ignore masks (ShapeDrawable).
parentBackground = drawable.getClass().equals(ShapeDrawable.class) ? null : drawable;

} else if (ignoreTransparent) {

// No layers, ignore transparent drawable.
parentBackground = null;
}
}
if (parentBackground instanceof ColorDrawable) {
final ColorDrawable colorDrawable = (ColorDrawable) parentBackground;

if (ignoreTransparent && colorDrawable.getColor() == Color.TRANSPARENT) {
if (ignoreTransparent && Color.alpha(colorDrawable.getColor()) <= 0) {

// Ignore transparent backgrounds.
parentBackground = null;
}
} else if (parentBackground instanceof PaintDrawable) {
final PaintDrawable paintDrawable = (PaintDrawable) parentBackground;

if (ignoreTransparent && Color.alpha(paintDrawable.getPaint().getColor()) <= 0) {

// Ignore transparent backgrounds.
parentBackground = null;
Expand Down Expand Up @@ -290,7 +318,9 @@ public void onChildDraw(@NonNull Canvas c,
// Determine if current background is transparent.
final boolean hasTransparentBackground = currentBackground == null
|| (currentBackground instanceof ColorDrawable
&& ((ColorDrawable) currentBackground).getColor() == Color.TRANSPARENT);
&& Color.alpha(((ColorDrawable) currentBackground).getColor()) <= 0)
|| (currentBackground instanceof PaintDrawable
&& Color.alpha(((PaintDrawable) currentBackground).getPaint().getColor()) <= 0);

if (hasTransparentBackground) {
final TiUIView parentView = recyclerViewProxy.getOrCreateView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import android.app.Activity;
import android.view.View;

import androidx.annotation.NonNull;

import ti.modules.titanium.ui.UIModule;
import ti.modules.titanium.ui.widget.TiView;

Expand Down Expand Up @@ -677,5 +679,12 @@ public ItemView(TiViewProxy proxy)

getLayoutParams().autoFillsWidth = true;
}

@Override
protected boolean canApplyTouchFeedback(@NonNull KrollDict props)
{
// Prevent TiUIView from overriding `touchFeedback` effect.
return false;
}
}
}

0 comments on commit 6dab5a3

Please sign in to comment.