本文整理汇总了Java中com.archos.filecorelibrary.Utils.getFileNameWithoutExtension方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getFileNameWithoutExtension方法的具体用法?Java Utils.getFileNameWithoutExtension怎么用?Java Utils.getFileNameWithoutExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.archos.filecorelibrary.Utils
的用法示例。
在下文中一共展示了Utils.getFileNameWithoutExtension方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateNowPlayingMetadata
import com.archos.filecorelibrary.Utils; //导入方法依赖的package包/类
/**
* Update title and pic on now playing card
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void updateNowPlayingMetadata() {
MediaMetadata.Builder metadataBuilder = new MediaMetadata.Builder();
String title = mVideoInfo.scraperTitle!=null?mVideoInfo.scraperTitle:mVideoInfo.title!=null?mVideoInfo.title:Utils.getFileNameWithoutExtension(mUri);
metadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_TITLE,
title);
metadataBuilder.putString(MediaMetadata.METADATA_KEY_TITLE,title);
metadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_ICON_URI,
mVideoInfo.scraperCover);
Bitmap bitmap = BitmapFactory.decodeFile(mVideoInfo.scraperCover);
if (bitmap == null&&mVideoInfo.id >= 0) { //if no scrapped poster, try to get a thumbnail
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 2;
bitmap = VideoStore.Video.Thumbnails.getThumbnail(getContentResolver(),mVideoInfo.id, VideoStore.Video.Thumbnails.MINI_KIND, options);
}
if (bitmap == null) {
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.widget_default_video);
}
metadataBuilder.putBitmap(MediaMetadata.METADATA_KEY_ART, bitmap);
mSession.setMetadata(metadataBuilder.build());
}
示例2: startStatusbarNotification
import com.archos.filecorelibrary.Utils; //导入方法依赖的package包/类
public void startStatusbarNotification(boolean isDicreteOrMinimized) {
Intent notificationIntent = new Intent("DISPLAY_FLOATING_PLAYER");
PendingIntent contentIntent = PendingIntent.getBroadcast(this, 0, notificationIntent, 0);
mNotificationBuilder = new NotificationCompat.Builder(this);
int icon = R.drawable.video2;
mNotificationBuilder.setSmallIcon(icon);
mNotificationBuilder.setTicker(null);
mNotificationBuilder.setOnlyAlertOnce(true);
String title = "";
if(getVideoInfo()!=null&&PlayerService.sPlayerService.getVideoInfo().scraperTitle!=null&&!PlayerService.sPlayerService.getVideoInfo().scraperTitle.isEmpty())
title = sPlayerService.getVideoInfo().scraperTitle;
else if(getVideoInfo()!=null&&getVideoInfo().title!=null)
title = getVideoInfo().title;
else
title = Utils.getFileNameWithoutExtension(mUri);
mNotificationBuilder.setContentTitle(getString(R.string.now_playing));
mNotificationBuilder.setContentText(title);
mNotificationBuilder.setContentIntent(contentIntent);
if(mPlayer!=null){
if(mPlayer.isPlaying())
mNotificationBuilder.addAction(new NotificationCompat.Action(R.drawable.video_pause, getString(R.string.floating_player_pause), PendingIntent.getBroadcast(this, 0, new Intent(PAUSE_INTENT),0)));
else if(mPlayer.isInPlaybackState())
mNotificationBuilder.addAction(new NotificationCompat.Action(R.drawable.video_play, getString(R.string.floating_player_play), PendingIntent.getBroadcast(this, 0, new Intent(PLAY_INTENT),0)));
}
if(isDicreteOrMinimized)
mNotificationBuilder.addAction(new NotificationCompat.Action(R.drawable.ic_menu_unfade, getString(R.string.floating_player_restore), contentIntent));
else
mNotificationBuilder.addAction(new NotificationCompat.Action(R.drawable.video_format_fullscreen, getString(R.string.format_fullscreen), PendingIntent.getBroadcast(this, 0, new Intent(FULLSCREEN_INTENT),0)));
mNotificationBuilder.setDeleteIntent(PendingIntent.getBroadcast(this, 0, new Intent(EXIT_INTENT), 0));
mNotificationBuilder.setOngoing(false);
mNotificationBuilder.setDefaults(0);
mNotificationBuilder.setAutoCancel(true);
Notification notif = mNotificationBuilder.build();
//notif.bigContentView = new RemoteViews(getPackageName(), R.layout.notification_controls);
startForeground(PLAYER_NOTIFICATION_ID, notif);
}
示例3: exportInternal
import com.archos.filecorelibrary.Utils; //导入方法依赖的package包/类
private static void exportInternal(Uri video, MovieTags tag) throws IOException {
String videoName = Utils.getFileNameWithoutExtension(video);
Uri parent = Utils.getParentUrl(video);
Uri exportTarget = Uri.withAppendedPath(parent, videoName + NfoParser.CUSTOM_NFO_EXTENSION);
try {
FileEditor editor = FileEditorFactoryWithUpnp.getFileEditorForUrl(exportTarget, null);
// Delete existing file to avoid overwrite issue (end of previous content still there is the new content is shorter)
if (editor.exists()) {
editor.delete();
}
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
editor.getOutputStream(), StringUtils.CHARSET_UTF8));
try {
XmlSerializer serializer = initAndStartDocument(writer);
writeXmlInner(serializer, tag);
endDocument(serializer);
writer.close();
writer = null;
exportImage(tag.getDefaultPoster(), parent, videoName + NfoParser.POSTER_EXTENSION);
exportImage(tag.getDefaultBackdrop(), parent, videoName + NfoParser.BACKDROP_EXTENSION);
} finally {
if (writer != null) {
// writer is only != null if writing nfo has thrown an exception
// -> get rid of potentially semi-complete nfo files.
editor.delete();
IOUtils.closeSilently(writer);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例4: onCreate
import com.archos.filecorelibrary.Utils; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
if (DBG) Log.d(TAG, "onCreate");
super.onCreate(icicle);
setContentView(R.layout.subtitles_wizard_main);
// Extract the path of the video to handle from the intent
Uri videoUri = getIntent().getData();
// FIXME: this is broken for smb:// files
if (videoUri != null) {
mVideoUri = videoUri;
mVideoPath = videoUri.getPath();
if (DBG) Log.d(TAG, "onCreate : video to process = " + mVideoPath);
if (mVideoPath != null) {
File videoFile = new File(mVideoPath);
// Retrieve the list of subtitles files already associated with the video
mCurrentFilesCount = buildCurrentSubtitlesFilesList(mVideoPath);
if (DBG) Log.d(TAG, "onCreate : mCurrentFilesCount = " + mCurrentFilesCount);
// Get the list of subtitles files available in the current folder
mAvailableFilesCount = buildAvailableSubtitlesFilesList(videoFile.getParent());
if (DBG) Log.d(TAG, "onCreate : mAvailableFilesCount = " + mAvailableFilesCount);
}
}
else {
// Bad intent
Log.e(TAG, "onCreate error : no folder provided");
mVideoUri = null;
}
// Use the name of the video to build the help message displayed at the top of the screen
TextView helpMessageHeader = (TextView) findViewById(R.id.help_message_header);
String name = Utils.getFileNameWithoutExtension(mVideoUri);
String helpMessage;
if (mAvailableFilesCount == 0 && mCurrentFilesCount == 0) {
helpMessage = getString(R.string.subtitles_wizard_empty_list_help).replace("%s", name);
}
else {
helpMessage = getString(R.string.subtitles_wizard_help).replace("%s", name);
}
helpMessageHeader.setText(helpMessage);
// Inflate the view to show if no subtitles files are found
mEmptyView = (TextView) LayoutInflater.from(this).inflate(R.layout.browser_empty_item, null);
mListView = (ListView) findViewById(R.id.list_items);
mListView.setEmptyView(mEmptyView);
SubtitlesWizardAdapter adapter = new SubtitlesWizardAdapter(getApplication(), this);
mListView.setAdapter(adapter);
mListView.setCacheColorHint(0);
mListView.setOnItemClickListener(this);
mListView.setOnCreateContextMenuListener(this);
mListView.setSelector(R.drawable.list_selector_no_background);
//mDefaultIconsColor = getResources().getColor(R.color.default_icons_color_filter);
// Handle the message to display when there are no files
enableEmptyView(mAvailableFilesCount == 0 && mCurrentFilesCount == 0);
}