本文整理汇总了Java中wei.mark.standout.StandOutWindow类的典型用法代码示例。如果您正苦于以下问题:Java StandOutWindow类的具体用法?Java StandOutWindow怎么用?Java StandOutWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StandOutWindow类属于wei.mark.standout包,在下文中一共展示了StandOutWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDestroy
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
public void onDestroy() {
super.onDestroy();
if (twitter != null) {
windowManager.removeView(twitter);
twitter = null;
}
notificationManager.cancel(0);
save("on", "false");
save("chatheadon", "false");
loadon();
StandOutWindow.closeAll(ChatHead.this, FloatingActivity.class);
}
示例2: onReceiveData
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
public void onReceiveData(int id, int requestCode, Bundle data,
Class<? extends StandOutWindow> fromCls, int fromId) {
// receive data from WidgetsWindow's button press
// to show off the data sending framework
switch (requestCode) {
case WidgetsWindow.DATA_CHANGED_TEXT:
Window window = getWindow(id);
if (window == null) {
String errorText = String.format(Locale.US,
"%s received data but Window id: %d is not open.",
getAppName(), id);
Toast.makeText(this, errorText, Toast.LENGTH_SHORT).show();
return;
}
String changedText = data.getString("changedText");
TextView status = (TextView) window.findViewById(R.id.id);
status.setTextSize(20);
status.setText("Received data from WidgetsWindow: "
+ changedText);
break;
default:
Log.d("MultiWindow", "Unexpected data received.");
break;
}
}
示例3: onProgressChanged
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
int newValue = progress + mMinValue;
if (newValue > mMaxValue)
newValue = mMaxValue;
else if (newValue < mMinValue)
newValue = mMinValue;
else if (mInterval != 1 && newValue % mInterval != 0)
newValue = Math.round(((float) newValue) / mInterval) * mInterval;
// change rejected, revert to the previous value
if (!callChangeListener(newValue)) {
seekBar.setProgress(mCurrentValue - mMinValue);
return;
}
// change accepted, store it
mCurrentValue = newValue;
mStatusText.setText(String.valueOf(pxFromDp(newValue)));
persistInt(newValue);
// Refresh the corners to apply the new radius
StandOutWindow.sendData(context, Corner.class, Corner.wildcard, Corner.UPDATE_CODE, new Bundle(), Corner.class, StandOutWindow.DISREGARD_ID);
}
示例4: onCreate
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (!BootReceiver.boot_up || Corner.running) {
Intent i = new Intent(this, SettingsActivity.class);
startActivity(i);
}
if (prefs.getBoolean("enable", true)) {
StandOutWindow.show(this, Corner.class, 0);
StandOutWindow.show(this, Corner.class, 1);
StandOutWindow.show(this, Corner.class, 2);
StandOutWindow.show(this, Corner.class, 3);
}
finish();
}
示例5: createAndAttachView
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
public void createAndAttachView(int id, FrameLayout frame) {
// create a new layout from body.xml
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.dialog, frame, true);
ImageView PinBtn = (ImageView) view.findViewById(R.id.pinit);
PinBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.d("PopBell", "DialogWindow Pinit Button");
StandOutWindow.closeAll(DialogWindow.this,
PinedDialogWindow.class);
StandOutWindow.show(DialogWindow.this, PinedDialogWindow.class,
StandOutWindow.DEFAULT_ID);
stopSelf();
}
});
}
示例6: checkDatabase
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
private void checkDatabase() {
DatabaseHelper dbHelper = new DatabaseHelper(getApplicationContext());
try {
// Get all the remotes from the Database
dbHelper.open();
Cursor cur = dbHelper.getAllRemotes();
if(cur.getCount() != 0)
{
StandOutWindow.closeAll(this, StandOutRemoteActivity.class);
StandOutWindow.show(this, StandOutRemoteActivity.class, StandOutWindow.DEFAULT_ID);
}
cur.close();
dbHelper.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
示例7: onActivityResult
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (resultCode == RESULT_OK ) {
if (requestCode == REQUEST_PICK_APPWIDGET) {
configureWidget(data);
}
else if (requestCode == REQUEST_CREATE_APPWIDGET) {
smAppWidgetHost = mAppWidgetHost;
smAppWidgetManager = mAppWidgetManager;
widget = data;
if(widget == null && BuildConfig.DEBUG) Log.e("Floating Widgets","Fasten seat belts and prepare for crash");
StandOutWindow.show(this,FloatingWidget.class,++id);
finish();
}
}
else if (resultCode == RESULT_CANCELED && data != null) {
int appWidgetId =
data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
if (appWidgetId != -1) {
mAppWidgetHost.deleteAppWidgetId(appWidgetId);
}
}
}
示例8: configureWidget
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
private void configureWidget(Intent data) {
Bundle extras = data.getExtras();
int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
AppWidgetProviderInfo appWidgetInfo =
mAppWidgetManager.getAppWidgetInfo(appWidgetId);
if (appWidgetInfo.configure != null) {
Intent intent =
new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
intent.setComponent(appWidgetInfo.configure);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
startActivityForResult(intent, REQUEST_CREATE_APPWIDGET);
} else {
smAppWidgetHost = mAppWidgetHost;
smAppWidgetManager = mAppWidgetManager;
widget = data;
if(widget == null) Log.e("Floating Widgets","Fasten seat belts and prepare for crash");
StandOutWindow.show(this,FloatingWidget.class,++id);
finish();
}
}
示例9: onDoubleTap
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
public boolean onDoubleTap(int id, Window window, MotionEvent event) {
Set<Integer> ids = StandOutWindow.sWindowCache.getCacheIds(FloatingWidget.class);
for (int i: ids)
{
if (i != FLOAT_UNIQUE_ID)
{
//Send data to the Floating Widget service to restore the hidden Widgets
getStandOutContext().sendData(FLOAT_UNIQUE_ID,FloatingWidget.class,i,0,null);
IS_MINIMIZED = false;
break;
}
}
stopSelf();
return super.onDoubleTap(id, window, event);
}
示例10: getAddRunnable
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
public Runnable getAddRunnable(int id) {
return new Runnable() {
@Override
public void run() {
StandOutWindow.show(FloatingSticky.this.getApplicationContext(), FloatingSticky.class, getUniqueId());
}
};
}
示例11: onCreate
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StandOutWindow.closeAll(this, ToggleWindow.class);
StandOutWindow.show(this, ToggleWindow.class, StandOutWindow.DEFAULT_ID);
finish();
}
示例12: onCreate
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StandOutWindow.closeAll(this, SimpleWindow.class);
StandOutWindow.closeAll(this, MultiWindow.class);
StandOutWindow.closeAll(this, WidgetsWindow.class);
// show a MultiWindow, SimpleWindow
StandOutWindow
.show(this, SimpleWindow.class, StandOutWindow.DEFAULT_ID);
StandOutWindow.show(this, MultiWindow.class, StandOutWindow.DEFAULT_ID);
StandOutWindow.show(this, WidgetsWindow.class,
StandOutWindow.DEFAULT_ID);
// show a MostBasicWindow. It is commented out because it does not
// support closing.
/*
* StandOutWindow.show(this, StandOutMostBasicWindow.class,
* StandOutWindow.DEFAULT_ID);
*/
finish();
}
示例13: onCreate
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
StandOutWindow.closeAll(this, FloatingFolder.class);
FloatingFolder.showFolders(this);
finish();
}
示例14: onStartCommand
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent != null) {
String action = intent.getAction();
int corner = intent.getIntExtra("id", DEFAULT_ID);
if (corner == ONGOING_NOTIFICATION_ID) {
throw new RuntimeException("ID cannot equals StandOutWindow.ONGOING_NOTIFICATION_ID");
}
if (ACTION_SHOW.equals(action) || ACTION_RESTORE.equals(action)) {
show(corner);
} else if (ACTION_SETTINGS.equals(action)) {
try {
Intent intentS = new Intent(this, SettingsActivity.class);
intentS.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentS);
} catch (Exception e) {
// Addressing this issue: http://i.imgur.com/Op9kfy8.png
}
} else if (ACTION_HIDE.equals(action)) {
hide(corner);
} else if (ACTION_CLOSE.equals(action)) {
close(corner);
} else if (ACTION_CLOSE_ALL.equals(action)) {
closeAll();
} else if (ACTION_SEND_DATA.equals(action)) {
if (isExistingId(corner) || corner == DISREGARD_ID) {
Bundle data = intent.getBundleExtra("wei.mark.standout.data");
int requestCode = intent.getIntExtra("requestCode", 0);
@SuppressWarnings("unchecked")
Class<? extends StandOutWindow> fromCls = (Class<? extends StandOutWindow>) intent.getSerializableExtra("wei.mark.standout.fromCls");
int fromId = intent.getIntExtra("fromId", DEFAULT_ID);
onReceiveData(corner, requestCode, data, fromCls, fromId);
}
}
}
return START_NOT_STICKY;
}
示例15: OpenPinedWindow
import wei.mark.standout.StandOutWindow; //导入依赖的package包/类
public Runnable OpenPinedWindow(int id) {
return new Runnable() {
@Override
public void run() {
StandOutWindow.show(PinedDialogWindow.this.getApplicationContext(), PinedDialogWindow.class, getUniqueId());
}
};
}