use of org.videolan.vlc.gui.video.MediaInfoAdapter in project vlc-android by GeoffreyMetais.
the class InfoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = DataBindingUtil.setContentView(this, R.layout.info_activity);
initAudioPlayerContainerActivity();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mItem = (MediaLibraryItem) (savedInstanceState != null ? savedInstanceState.getParcelable(TAG_ITEM) : getIntent().getParcelableExtra(TAG_ITEM));
if (mItem == null) {
finish();
return;
}
if (mItem.getId() == 0L) {
MediaLibraryItem libraryItem = VLCApplication.getMLInstance().getMedia(((MediaWrapper) mItem).getUri());
if (libraryItem != null)
mItem = libraryItem;
}
mBinding.setItem(mItem);
final int fabVisibility = savedInstanceState != null ? savedInstanceState.getInt(TAG_FAB_VISIBILITY) : -1;
if (!TextUtils.isEmpty(mItem.getArtworkMrl())) {
WorkersKt.runBackground(new Runnable() {
@Override
public void run() {
final Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(mItem.getArtworkMrl()), 0);
if (cover != null) {
mBinding.setCover(new BitmapDrawable(InfoActivity.this.getResources(), cover));
WorkersKt.runOnMainThread(new Runnable() {
@Override
public void run() {
ViewCompat.setNestedScrollingEnabled(mBinding.container, true);
mBinding.appbar.setExpanded(true, true);
if (fabVisibility != -1)
mBinding.fab.setVisibility(fabVisibility);
}
});
} else
noCoverFallback();
}
});
} else
noCoverFallback();
mBinding.fab.setOnClickListener(this);
if (mItem.getItemType() == MediaLibraryItem.TYPE_MEDIA) {
mAdapter = new MediaInfoAdapter();
mBinding.list.setLayoutManager(new LinearLayoutManager(mBinding.getRoot().getContext()));
mBinding.list.setAdapter(mAdapter);
mCheckFileTask = (CheckFileTask) new CheckFileTask().execute();
mParseTracksTask = (ParseTracksTask) new ParseTracksTask().execute();
}
WorkersKt.runBackground(new Runnable() {
@Override
public void run() {
updateMeta();
}
});
}
use of org.videolan.vlc.gui.video.MediaInfoAdapter in project vlc-android by videolan.
the class InfoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = DataBindingUtil.setContentView(this, R.layout.info_activity);
initAudioPlayerContainerActivity();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mItem = (MediaLibraryItem) (savedInstanceState != null ? savedInstanceState.getParcelable(TAG_ITEM) : getIntent().getParcelableExtra(TAG_ITEM));
if (mItem == null) {
finish();
return;
}
if (mItem.getId() == 0L) {
MediaLibraryItem libraryItem = VLCApplication.getMLInstance().getMedia(((MediaWrapper) mItem).getUri());
if (libraryItem != null)
mItem = libraryItem;
}
mBinding.setItem(mItem);
final int fabVisibility = savedInstanceState != null ? savedInstanceState.getInt(TAG_FAB_VISIBILITY) : -1;
if (!TextUtils.isEmpty(mItem.getArtworkMrl())) {
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
final Bitmap cover = AudioUtil.readCoverBitmap(Uri.decode(mItem.getArtworkMrl()), 0);
if (cover != null) {
mBinding.setCover(new BitmapDrawable(InfoActivity.this.getResources(), cover));
VLCApplication.runOnMainThread(new Runnable() {
@Override
public void run() {
ViewCompat.setNestedScrollingEnabled(mBinding.container, true);
mBinding.appbar.setExpanded(true, true);
if (fabVisibility != -1)
mBinding.fab.setVisibility(fabVisibility);
}
});
} else
noCoverFallback();
}
});
} else
noCoverFallback();
mBinding.fab.setOnClickListener(this);
if (mItem.getItemType() == MediaLibraryItem.TYPE_MEDIA) {
mAdapter = new MediaInfoAdapter();
mBinding.list.setLayoutManager(new LinearLayoutManager(mBinding.getRoot().getContext()));
mBinding.list.setAdapter(mAdapter);
mCheckFileTask = (CheckFileTask) new CheckFileTask().execute();
mParseTracksTask = (ParseTracksTask) new ParseTracksTask().execute();
}
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
updateMeta();
}
});
}
Aggregations