-
Notifications
You must be signed in to change notification settings - Fork 729
Put song title text view into a horizontal scrollview so you can see the full song title on songs with longer song titles #160
base: master
Are you sure you want to change the base?
Changes from 7 commits
85b2aab
7ad72c5
989d086
f405353
c33623d
b232b39
1d990f8
f07d337
5e92a74
dc7b7b2
4743027
585f9e7
c697fa7
677d033
0b7c234
0f003ad
8c18349
d7cfe75
f6dd635
f5e4aba
76ab6ee
896c4f7
d1bc242
ebf0d0e
8689c45
7df7e55
f35bd92
91ecba3
0cc5fc7
df46c8e
0baa2e0
0738982
ba6a88e
0c22e8e
b0797a5
822421f
1703199
f1a9ad2
25f80e8
9eb947e
e933d59
d3a1e36
3c3fec9
3667521
63cd45d
f0bf36b
0e0d893
84f8023
25099c9
6057efa
885a606
6a3cbec
194837f
1d42670
f85f927
096786c
404a87b
19a02bc
0f99fd7
c96bc95
fbbb5e9
fc61205
dc8f4d9
841aca0
5d18033
af7b37b
c2964fb
3398136
9fce7f6
547ed42
5cf52b5
b7ef464
cafa622
bb8833c
ad51a4c
06ec3ef
e565a42
f95a90e
726ceb1
c2fc441
f587840
6b72b35
d286e8f
e7d1da6
9c27672
1633340
cbf25cb
95426e6
78c2a09
a0bfa37
e3b3fa0
780f0d7
e9596ed
caa3d2c
a617668
ac46c30
4237452
a24bd98
b2971b3
0c68210
6f600b6
1800182
f09c145
8bef5cc
3b3104e
9eb14b6
78890be
26548dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,7 @@ captures/ | |
|
||
# Mac | ||
.DS_Store | ||
|
||
*.gradle | ||
|
||
build.gradle |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.kabouzeid.gramophone.views; | ||
|
||
import android.content.Context; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
import android.util.AttributeSet; | ||
import android.view.MotionEvent; | ||
import android.widget.FrameLayout; | ||
|
||
/** | ||
* Created by lincoln on 6/8/17. | ||
*/ | ||
|
||
/** | ||
* A custom FrameLayout view that intercepts touch events and decides whether to consume them or | ||
* pass on the touch events to it's children | ||
*/ | ||
public class CustomFrameLayout extends FrameLayout { | ||
|
||
public CustomFrameLayout(@NonNull Context context) { | ||
super(context); | ||
} | ||
|
||
public CustomFrameLayout(@NonNull Context context, @Nullable AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public CustomFrameLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
} | ||
|
||
/** | ||
* This intercepts the touch event and, by returning false, passes the touchevent to both itself and it's | ||
* child views (by calling TouchEvent it passes it to itself). However, if the action is ACTION_MOVE it cancels the touch event in itself and | ||
* only gives it to it's children, which, in this case is a HorizontalScrollView | ||
* @param e the intercepted touch event | ||
* @return If this function returns true, the MotionEvent will be intercepted, | ||
* meaning it will be not be passed on to the child, but rather to the onTouchEvent of this View. | ||
*/ | ||
@Override | ||
public boolean onInterceptTouchEvent(MotionEvent e) { | ||
|
||
switch (e.getAction()) { | ||
case MotionEvent.ACTION_MOVE: { | ||
MotionEvent eUp = e; | ||
eUp.setAction(MotionEvent.ACTION_CANCEL); | ||
onTouchEvent(eUp); | ||
} | ||
} | ||
onTouchEvent(e); | ||
return false; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
android:state_activated="true" | ||
android:drawable="@color/ripple_material_light" /> | ||
</selector> | ||
|
||
</item> | ||
|
||
</ripple> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<item android:drawable="@color/ripple_material_light" android:state_activated="true" android:state_pressed="true" /> | ||
<item android:drawable="@color/ripple_material_light" android:state_activated="true" /> | ||
<item android:drawable="@color/ripple_material_light" android:state_pressed="true" /> | ||
<item android:color="@color/ripple_material_light" android:state_activated="true" android:state_pressed="true" /> | ||
<item android:color="@color/ripple_material_light" android:state_activated="true" /> | ||
<item android:color="@color/ripple_material_light" android:state_pressed="true" /> | ||
<item android:drawable="@android:color/transparent" /> | ||
|
||
</selector> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<com.kabouzeid.gramophone.views.CustomFrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="72dp" | ||
|
@@ -20,7 +20,16 @@ | |
android:tintMode="src_in" | ||
tools:ignore="ContentDescription" /> | ||
|
||
<View | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So is this just a dummy view for intercepting touches? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just a regular framelayout, but I've Overrided onInterceptTouch so I can delegate any touches to the right views. In this case either the HorizontalScrollView or this FrameLayout. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should put a comment here for future reference so people know what this is for. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I plan on going through this and documenting everything tonight, but I'll definitely do this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @arkon Let me know if there's anything you still see that might not be so clear. I'm pretty sure I explained everything, but I'd be surprised if I didn't miss a thing or two. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll look through the view classes tomorrow evening. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what is this invisible view for again? |
||
android:id="@+id/empty_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@android:color/background_dark" | ||
android:alpha="0" | ||
/> | ||
|
||
<LinearLayout | ||
android:id="@+id/song_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:descendantFocusability="blocksDescendants" | ||
|
@@ -65,15 +74,28 @@ | |
android:paddingEnd="0dp" | ||
android:paddingLeft="16dp" | ||
android:paddingRight="0dp" | ||
android:paddingStart="16dp"> | ||
android:paddingStart="16dp" | ||
android:descendantFocusability="blocksDescendants" | ||
> | ||
|
||
<TextView | ||
android:id="@+id/title" | ||
<HorizontalScrollView | ||
android:id="@+id/title_scrollview" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:fontFamily="sans-serif" | ||
android:singleLine="true" | ||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" /> | ||
android:layout_height="fill_parent" | ||
android:scrollbars="none"> | ||
|
||
<TextView | ||
android:id="@+id/title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:fontFamily="sans-serif" | ||
android:singleLine="true" | ||
android:scrollHorizontally="true" | ||
android:ellipsize="none" | ||
android:clickable="true" | ||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/> | ||
|
||
</HorizontalScrollView> | ||
|
||
<TextView | ||
android:id="@+id/text" | ||
|
@@ -110,4 +132,4 @@ | |
android:layout_marginStart="72dp" | ||
android:background="?attr/dividerColor" /> | ||
|
||
</FrameLayout> | ||
</com.kabouzeid.gramophone.views.CustomFrameLayout> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="twenty_percent_black_overlay">#34000000</color> | ||
|
||
<color name="ripple_control_lighter">#60000000</color> | ||
<color name="app_shortcut_default_foreground">#607d8b</color> | ||
<color name="app_shortcut_default_background">#f5f5f5</color> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
maven { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should just leave this out of this PR for now. |
||
url 'https://maven.google.com' | ||
} | ||
|
||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.3.1' | ||
classpath 'com.android.tools.build:gradle:3.0.0-alpha3' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not yet in the production branch |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Apr 11 17:46:33 SGT 2017 | ||
#Wed Jun 07 15:02:52 EDT 2017 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should just leave this out of this PR for now. |
||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not yet in the production branch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right. My git configuration got messed up, I'll remove these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These shouldn't be in the gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted