add downloads menu item

This commit is contained in:
Christian Schabesberger 2016-05-24 14:06:49 +02:00
parent 14aa6de422
commit 6f6c1704d4
5 changed files with 11 additions and 2 deletions

View file

@ -18,6 +18,7 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.Toast; import android.widget.Toast;
import org.schabi.newpipe.download.MainActivity;
import org.schabi.newpipe.extractor.ExtractionException; import org.schabi.newpipe.extractor.ExtractionException;
import org.schabi.newpipe.extractor.SearchEngine; import org.schabi.newpipe.extractor.SearchEngine;
import org.schabi.newpipe.extractor.ServiceList; import org.schabi.newpipe.extractor.ServiceList;
@ -366,6 +367,10 @@ public class VideoItemListActivity extends AppCompatActivity
"user_report", R.string.user_report)); "user_report", R.string.user_report));
return true; return true;
} }
case R.id.action_show_downloads: {
//todo: implement this
return true;
}
default: default:
return videoFragment.onOptionsItemSelected(item) || return videoFragment.onOptionsItemSelected(item) ||
super.onOptionsItemSelected(item); super.onOptionsItemSelected(item);

View file

@ -217,6 +217,7 @@ public class DownloadDialog extends DialogFragment {
String fName = name.getText().toString().trim(); String fName = name.getText().toString().trim();
// todo: add timeout? would be bad if the thread gets locked dueto this.
while (mBinder == null); while (mBinder == null);
if(audio.isChecked()){ if(audio.isChecked()){

View file

@ -58,7 +58,6 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIte
private static final String TAG = MainActivity.class.toString(); private static final String TAG = MainActivity.class.toString();
private Menu menu = null;
private MissionsFragment mFragment; private MissionsFragment mFragment;
private DownloadManager mManager; private DownloadManager mManager;
@ -242,7 +241,6 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIte
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu); super.onCreateOptionsMenu(menu);
this.menu = menu;
MenuInflater inflater = getMenuInflater(); MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.download_menu, menu); inflater.inflate(R.menu.download_menu, menu);

View file

@ -11,6 +11,10 @@
app:showAsAction="never" app:showAsAction="never"
android:title="@string/settings"/> android:title="@string/settings"/>
<item android:id="@+id/action_show_downloads"
app:showAsAction="never"
android:title="@string/downloads" />
<item android:id="@+id/action_report_error" <item android:id="@+id/action_report_error"
app:showAsAction="never" app:showAsAction="never"
android:title="@string/report_error" /> android:title="@string/report_error" />

View file

@ -79,6 +79,7 @@
<string name="show_age_restricted_content_title">Show age restricted content</string> <string name="show_age_restricted_content_title">Show age restricted content</string>
<string name="video_is_age_restricted">Video is Age restricted. Enable age restricted videos in the settings first.</string> <string name="video_is_age_restricted">Video is Age restricted. Enable age restricted videos in the settings first.</string>
<string name="duration_live">live</string> <string name="duration_live">live</string>
<string name="downloads">Downloads</string>
<!-- error strings --> <!-- error strings -->
<string name="general_error">Error</string> <string name="general_error">Error</string>