Improved usability for NowPlayingPanel (#432)
* Panel now only closes when collapsed bar is clicked. This prevents unwanted closing when using the sliders and buttons. * Moved collapsed panel size to the compound view so users of the NowPlayingPanel don't need to look inside the compound view layout to determine the correct size.
This commit is contained in:
parent
8cd974137b
commit
590050e751
|
@ -24,6 +24,7 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||||
|
@ -49,6 +50,7 @@ public class NowPlayingPanel extends SlidingUpPanelLayout {
|
||||||
|
|
||||||
private OnPanelButtonsClickListener onPanelButtonsClickListener;
|
private OnPanelButtonsClickListener onPanelButtonsClickListener;
|
||||||
|
|
||||||
|
@InjectView(R.id.npp_collapsed_view) LinearLayout collapsedView;
|
||||||
@InjectView(R.id.npp_title) TextView title;
|
@InjectView(R.id.npp_title) TextView title;
|
||||||
@InjectView(R.id.npp_details) TextView details;
|
@InjectView(R.id.npp_details) TextView details;
|
||||||
@InjectView(R.id.npp_poster) ImageView poster;
|
@InjectView(R.id.npp_poster) ImageView poster;
|
||||||
|
@ -80,6 +82,7 @@ public class NowPlayingPanel extends SlidingUpPanelLayout {
|
||||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
View view = inflater.inflate(R.layout.now_playing_panel, this);
|
View view = inflater.inflate(R.layout.now_playing_panel, this);
|
||||||
ButterKnife.inject(view);
|
ButterKnife.inject(view);
|
||||||
|
setDragView(collapsedView);
|
||||||
setupButtonClickListeners();
|
setupButtonClickListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
sothree:umanoPanelHeight="@dimen/now_playing_panel_height"
|
|
||||||
sothree:umanoShadowHeight="4dp"
|
sothree:umanoShadowHeight="4dp"
|
||||||
sothree:umanoFadeColor="#00000000"
|
sothree:umanoFadeColor="#00000000"
|
||||||
sothree:umanoInitialState="hidden"/>
|
sothree:umanoInitialState="hidden"/>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
android:id="@+id/mpi_seek_bar"
|
android:id="@+id/mpi_seek_bar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="4dp"/>
|
android:layout_margin="4dp"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/mpi_duration"
|
android:id="@+id/mpi_duration"
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:sothree="http://schemas.android.com/apk/res-auto"
|
||||||
|
sothree:umanoPanelHeight="@dimen/now_playing_panel_height">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fragment_container"
|
android:id="@+id/fragment_container"
|
||||||
|
@ -26,6 +28,7 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/npp_collapsed_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
@ -111,8 +114,7 @@
|
||||||
<org.xbmc.kore.ui.widgets.MediaProgressIndicator
|
<org.xbmc.kore.ui.widgets.MediaProgressIndicator
|
||||||
android:id="@+id/npp_progress_indicator"
|
android:id="@+id/npp_progress_indicator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/buttonbar_height"
|
||||||
android:paddingTop="@dimen/default_padding"
|
|
||||||
android:paddingRight="@dimen/small_padding"
|
android:paddingRight="@dimen/small_padding"
|
||||||
android:paddingLeft="@dimen/small_padding"
|
android:paddingLeft="@dimen/small_padding"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
|
Loading…
Reference in New Issue