Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KDE Connect Android
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
21
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Network
KDE Connect Android
Commits
1b4ade0a
Commit
1b4ade0a
authored
10 years ago
by
Albert Vaca Cintora
Browse files
Options
Downloads
Patches
Plain Diff
MPRIS controls now adapt to tablet resolutions
BUG: 339684
parent
b9890210
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/kde/kdeconnect/UserInterface/MaxWidthImageButton.java
+29
-0
29 additions, 0 deletions
...org/kde/kdeconnect/UserInterface/MaxWidthImageButton.java
src/main/res/layout/mpris_control.xml
+21
-12
21 additions, 12 deletions
src/main/res/layout/mpris_control.xml
with
50 additions
and
12 deletions
src/main/java/org/kde/kdeconnect/UserInterface/MaxWidthImageButton.java
0 → 100644
+
29
−
0
View file @
1b4ade0a
package
org.kde.kdeconnect.UserInterface
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.util.AttributeSet
;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
public
class
MaxWidthImageButton
extends
ImageButton
{
public
MaxWidthImageButton
(
Context
context
)
{
super
(
context
);
}
public
MaxWidthImageButton
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
int
maxWidth
=
getMaxWidth
();
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
if
(
getMeasuredWidth
()
>
maxWidth
){
setMeasuredDimension
(
maxWidth
,
getMeasuredHeight
());
}
}
}
This diff is collapsed.
Click to expand it.
src/main/res/layout/mpris_control.xml
+
21
−
12
View file @
1b4ade0a
...
...
@@ -5,17 +5,21 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/mpris_control_view"
android:gravity=
"center"
>
android:gravity=
"center"
android:paddingLeft=
"50dip"
android:paddingTop=
"5dip"
android:paddingRight=
"50dip"
android:paddingBottom=
"5dip"
>
<Spinner
android:layout_width=
"
200dip
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:id=
"@+id/player_spinner"
android:layout_gravity=
"center"
/>
<TextView
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:id=
"@+id/now_playing_textview"
...
...
@@ -25,18 +29,22 @@
android:layout_gravity=
"center"
/>
<ImageButton
android:layout_width=
"
200dip
"
<
org.kde.kdeconnect.UserInterface.MaxWidth
ImageButton
android:layout_width=
"
fill_parent
"
android:layout_height=
"75dip"
android:maxWidth=
"300dip"
android:id=
"@+id/play_button"
android:src=
"@android:drawable/ic_media_play"
android:contentDescription=
"@string/mpris_play"
android:layout_gravity=
"center"
/>
android:layout_weight=
"0"
android:clickable=
"false"
android:adjustViewBounds=
"false"
android:baselineAlignBottom=
"true"
/>
<LinearLayout
android:orientation=
"horizontal"
android:layout_width=
"
200dip
"
android:layout_width=
"
match_parent
"
android:layout_height=
"50dip"
android:layout_gravity=
"center"
>
...
...
@@ -81,17 +89,18 @@
<LinearLayout
android:orientation=
"horizontal"
android:layout_width=
"
200dip
"
android:layout_width=
"
match_parent
"
android:layout_height=
"70dip"
android:id=
"@+id/volume_layout"
android:layout_gravity=
"center"
>
<ImageView
android:layout_width=
"50dip"
android:layout_height=
"50dip"
android:layout_width=
"30dip"
android:layout_height=
"30dip"
android:maxWidth=
"30dip"
android:layout_marginRight=
"10dip"
android:id=
"@+id/imageView"
android:layout_weight=
"
1
"
android:layout_weight=
"
0
"
android:layout_gravity=
"left|center_vertical"
android:contentDescription=
"@string/mpris_volume"
android:src=
"@drawable/ic_volume"
...
...
@@ -99,7 +108,7 @@
<SeekBar
android:layout_width=
"
fill_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:id=
"@+id/volume_seek"
android:layout_weight=
"1"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment