1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 19:12:45 +01:00

Merge branch 'dev' into clarify-bookmarks

This commit is contained in:
Christian Schabesberger 2018-10-06 12:01:34 +02:00 committed by GitHub
commit 42f777d49a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 42 deletions

View File

@ -16,6 +16,8 @@ import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -144,17 +146,21 @@ public abstract class MissionsFragment extends Fragment {
} }
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public void onPrepareOptionsMenu(Menu menu) {
return super.onOptionsItemSelected(item); mSwitch = menu.findItem(R.id.switch_mode);
super.onPrepareOptionsMenu(menu);
}
/*switch (item.getItemId()) { @Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.switch_mode: case R.id.switch_mode:
mLinear = !mLinear; mLinear = !mLinear;
updateList(); updateList();
return true; return true;
default: default:
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
}*/ }
} }
public void notifyChange() { public void notifyChange() {

View File

@ -9,7 +9,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_margin="2dp" android:layout_margin="2dp"
android:background="@color/bluegray"> android:background="@color/bluegray">
<ImageView <ImageView
android:id="@+id/item_icon" android:id="@+id/item_icon"
android:layout_width="72dp" android:layout_width="72dp"
@ -19,59 +19,52 @@
android:gravity="center" android:gravity="center"
android:padding="15dp" android:padding="15dp"
android:contentDescription="TODO" /> android:contentDescription="TODO" />
<LinearLayout <TextView
android:id="@+id/item_name_and_size" android:id="@+id/item_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/item_more"
android:layout_toRightOf="@id/item_icon" android:layout_toRightOf="@id/item_icon"
android:layout_toLeftOf="@+id/item_status" android:ellipsize="end"
android:layout_centerVertical="true" android:padding="6dp"
android:orientation="vertical"> android:text="XXX.xx"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/item_name" android:id="@+id/item_size"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="6dp" android:layout_toRightOf="@id/item_icon"
android:singleLine="true" android:layout_below="@+id/item_name"
android:ellipsize="end" android:padding="6dp"
android:text="XXX.xx" android:singleLine="true"
android:textSize="16sp" android:text="100.00MB"
android:textStyle="bold" android:textSize="12sp"
android:textColor="@color/white"/> android:textColor="@color/white"/>
<TextView
android:id="@+id/item_size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:singleLine="true"
android:text="100.00MB"
android:textSize="12sp"
android:textColor="@color/white"/>
</LinearLayout>
<TextView <TextView
android:id="@+id/item_status" android:id="@+id/item_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/item_more" android:layout_below="@+id/item_name"
android:layout_centerVertical="true"
android:layout_marginLeft="6dp" android:layout_marginLeft="6dp"
android:layout_marginRight="6dp" android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/item_more"
android:layout_toRightOf="@id/item_size"
android:padding="6dp"
android:singleLine="true" android:singleLine="true"
android:text="0%" android:text="0%"
android:textSize="20sp" android:textColor="@color/white"
android:textColor="@color/white"/> android:textSize="12sp" />
<ImageView <ImageView
style="?attr/buttonBarButtonStyle" style="?attr/buttonBarButtonStyle"
android:id="@+id/item_more" android:id="@+id/item_more"
android:layout_width="36dp" android:layout_width="49dp"
android:layout_height="36dp" android:layout_height="49dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="4dp" android:layout_marginRight="4dp"

View File

@ -5,4 +5,7 @@
<item android:id="@+id/action_settings" <item android:id="@+id/action_settings"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/settings"/> android:title="@string/settings"/>
<item android:id="@+id/switch_mode"
app:showAsAction="ifRoom"
android:title="@string/switch_view"/>
</menu> </menu>

View File

@ -517,5 +517,6 @@
<string name="minimize_on_exit_none_description">None</string> <string name="minimize_on_exit_none_description">None</string>
<string name="minimize_on_exit_background_description">Minimize to background player</string> <string name="minimize_on_exit_background_description">Minimize to background player</string>
<string name="minimize_on_exit_popup_description">Minimize to popup player</string> <string name="minimize_on_exit_popup_description">Minimize to popup player</string>
<string name="switch_view">Switch View</string>
</resources> </resources>