Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Nov 13, 2015
2 parents 5aabb29 + b652633 commit 2322ba8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/org/schabi/newpipe/VideoInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/


/**Info object for opened videos, ie the video ready to play.*/
public class VideoInfo {
public String id = "";
public String title = "";
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/org/schabi/newpipe/VideoInfoItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/

/**Info object for previews of unopened videos, eg search results, related videos*/
public class VideoInfoItem implements Parcelable {
public String id = "";
public String title = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;

import java.util.ArrayList;
import java.util.Arrays;

/**
Expand Down Expand Up @@ -114,13 +115,13 @@ protected void onCreate(Bundle savedInstanceState) {
Bundle arguments = getIntent().getExtras();

if(arguments != null) {
Parcelable[] p = arguments.getParcelableArray(VIDEO_INFO_ITEMS);
//Parcelable[] p = arguments.getParcelableArray(VIDEO_INFO_ITEMS);
ArrayList<VideoInfoItem> p = arguments.getParcelableArrayList(VIDEO_INFO_ITEMS);
if(p != null) {
mode = PRESENT_VIDEOS_MODE;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

//todo: make this more efficient
listFragment.present(Arrays.copyOf(p, p.length, VideoInfoItem[].class));
listFragment.present(p);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Vector;


Expand Down Expand Up @@ -167,14 +168,12 @@ public void run() {
}
}

public void present(VideoInfoItem[] videoList) {
public void present(List<VideoInfoItem> videoList) {
mode = PRESENT_VIDEOS_MODE;
setListShown(true);
getListView().smoothScrollToPosition(0);

// inefficient like hell i know (welcome to the world of java)
//todo: make this more efficient
updateList(new Vector<>(Arrays.asList(videoList)));
updateList(videoList);
}

public void search(String query) {
Expand Down Expand Up @@ -221,7 +220,7 @@ public void updateListOnResult(SearchEngine.Result result, int requestId) {
}
}

private void updateList(Vector<VideoInfoItem> list) {
private void updateList(List<VideoInfoItem> list) {
try {
videoListAdapter.addVideoList(list);
terminateThreads();
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/org/schabi/newpipe/VideoListAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.widget.BaseAdapter;
import android.widget.ListView;

import java.util.List;
import java.util.Vector;

/**
Expand Down Expand Up @@ -48,7 +49,7 @@ public VideoListAdapter(Context context, VideoItemListFragment videoListFragment
this.context = context;
}

public void addVideoList(Vector<VideoInfoItem> videos) {
public void addVideoList(List<VideoInfoItem> videos) {
videoList.addAll(videos);
for(int i = 0; i < videos.size(); i++) {
downloadedThumbnailList.add(false);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<string name="title_videoitem_detail">NewPipe</string>
<string name="nothingFound">Ничего не найдено</string>
<string name="viewSufix">просмотров</string>
<string name="uploadDatePrefix">"Опубликовано: "</string>
<string name="uploadDatePrefix">Опубликовано: </string>
<string name="noPlayerFound">Ни одного потокового проигрывателя не было найдено. Установить?</string>
<string name="installStreamPlayer">Установить</string>
<string name="cancel">Отмена</string>
Expand Down

0 comments on commit 2322ba8

Please sign in to comment.