📄 fbpictureupload.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3)
// Source File Name: FbPictureUpload.java
package com.sonyericsson.fb.ui.fbPages;
import com.sonyericsson.fb.api.request.FbAPIRequestWorker;
import com.sonyericsson.fb.api.request.FbUploadPhotoRequest;
import com.sonyericsson.fb.io.IFbProgressListener;
import com.sonyericsson.fb.strings.Strings;
import com.sonyericsson.fb.ui.fbComponents.listItems.FbTextItem;
import com.sonyericsson.fb.utils.Logger;
import com.sonyericsson.fb.utils.Properties;
import se.southend.drops.gui.RectangleSprite;
import se.southend.drops.scene.*;
import se.southend.drops.screen.KeyHandler;
// Referenced classes of package com.sonyericsson.fb.ui.fbPages:
// Page
public class FbPictureUpload extends Page
implements IFbProgressListener
{
public FbPictureUpload()
{
mSendingText = null;
mBackground = null;
mBackgroundBorder = null;
mLoadingStatus = null;
mTotalSize = 0L;
mTotalSendBytes = 0;
}
public void create()
{
if(mBackground != null || mLoadingStatus != null || mSendingText != null || mBackgroundBorder != null)
{
return;
} else
{
mBackground = new RectangleSprite(0xffffff, LOADING_STATUS_WIDTH, 40);
mBackground.setAnchor(20);
mBackgroundBorder = new RectangleSprite(0, LOADING_STATUS_WIDTH + 2, 42);
mBackgroundBorder.setAnchor(20);
mLoadingStatus = new RectangleSprite(0, 1, 40);
mLoadingStatus.setAnchor(20);
mSendingText = new FbTextItem(Strings.get(35), Properties.FONT_LARGE, 20, LOADING_STATUS_WIDTH, false);
add(mBackgroundBorder);
add(mBackground);
add(mLoadingStatus);
add(mSendingText);
mBackgroundBorder.setLocalPosition(-(LOADING_STATUS_WIDTH / 2 + 1) << 8, -7936);
mBackground.setLocalPosition(-LOADING_STATUS_WIDTH / 2 << 8, -7680);
mLoadingStatus.setLocalPosition(-LOADING_STATUS_WIDTH / 2 << 8, -7680);
mSendingText.setLocalPosition(2560, 7680);
return;
}
}
public void input(KeyHandler keyhandler)
{
}
public void setLoadingWidth(float value)
{
if(value > 1.0F || value < 0.0F || mLoadingStatus == null)
return;
int newWidth = (int)((float)LOADING_STATUS_WIDTH * value);
if(newWidth > 0)
mLoadingStatus.setSize(newWidth, 40);
}
public void uploadImage(String filePath, String MIMEtype, String albumId, String caption)
{
FbAPIRequestWorker.getInstance().addAPIRequest(new FbUploadPhotoRequest(null, this, filePath, MIMEtype, albumId, caption));
}
public void progress(long bytes)
{
if(mTotalSize != 0L)
{
mTotalSendBytes += bytes;
setLoadingWidth((float)mTotalSendBytes / (float)mTotalSize);
}
}
public void progressError()
{
Logger.printErrorln("FbPictureUpload.progressError(): Recived an error when uploading file\r\n");
}
public void progressFinished()
{
setLoadingWidth(1.0F);
}
public void progressStarted(long totalSize)
{
mTotalSendBytes = 0;
mTotalSize = totalSize;
}
private FbTextItem mSendingText;
private RectangleSprite mBackground;
private RectangleSprite mBackgroundBorder;
private RectangleSprite mLoadingStatus;
private long mTotalSize;
private int mTotalSendBytes;
private static final int UNIT = 8;
private static final int LOADING_STATUS_WIDTH;
private static final int LOADING_STATUS_HEIGHT = 40;
private static final int LOADING_STATUS_DISPOSITION = -30;
private static final int UPLOAD_TEXT_DISPOSITION_HEIGHT = 30;
private static final int UPLOAD_TEXT_DISPOSITION_WIDTH = 10;
static
{
LOADING_STATUS_WIDTH = Node.SCREEN_WIDTH - 40;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -