Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUC...
If you think the Android project DoomPlay listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.perm.DoomPlay;
/*www.java2s.com*//*
* Copyright 2013 Vladislav Krot
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* You can contact me <DoomPlaye@gmail.com>
*/import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
publicclass PageFragment extends Fragment
{
privatestaticfinal String argumentPageNumber = "arg_page_number";
privateint pageNumber;
static PageFragment newInstance(int page)
{
PageFragment pageFragment = new PageFragment();
Bundle arguments = new Bundle();
arguments.putInt(argumentPageNumber, page);
pageFragment.setArguments(arguments);
return pageFragment;
}
@Override
publicvoid onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
pageNumber = getArguments().getInt(argumentPageNumber);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState)
{
View page = inflater.inflate(R.layout.page,container,false);
ImageView imgAlbum = (ImageView)page.findViewById(R.id.imageAlbum);
TextView textNumberSong = (TextView)page.findViewById(R.id.textNumberSong);
FullPlaybackActivity activity = (FullPlaybackActivity)getActivity();
textNumberSong.setText(pageNumber + 1 + "/" + activity.audios.size());
Bitmap bitmap = AlbumArtGetter.getBitmapFromStore(activity.audios.get(pageNumber).getAid(),activity);
if(bitmap != null)
{
imgAlbum.setImageBitmap(bitmap);
bitmap.recycle();
}
return page;
}
}