当前位置: 首页>>代码示例>>Java>>正文


Java RemoteInput类代码示例

本文整理汇总了Java中android.app.RemoteInput的典型用法代码示例。如果您正苦于以下问题:Java RemoteInput类的具体用法?Java RemoteInput怎么用?Java RemoteInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RemoteInput类属于android.app包,在下文中一共展示了RemoteInput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: send

import android.app.RemoteInput; //导入依赖的package包/类
public static void send(String room, String message) throws IllegalArgumentException { // @author ManDongI
    Notification.Action session = null;

    for(KakaoData data : KakaoManager.getInstance().getDataList().toArray(new KakaoData[0])) {
        if(data.room.equals(room)) {
            session = data.session;

            break;
        }
    }

    if(session == null) {
        throw new IllegalArgumentException("Can't find the room");
    }

    Intent sendIntent = new Intent();
    Bundle msg = new Bundle();
    for (RemoteInput inputable : session.getRemoteInputs()) msg.putCharSequence(inputable.getResultKey(), message);
    RemoteInput.addResultsToIntent(session.getRemoteInputs(), sendIntent, msg);

    try {
        session.actionIntent.send(context, 0, sendIntent);

        Logger.Log log = new Logger.Log();
        log.type = Logger.Type.APP;
        log.title = "send message";
        log.index = "room: " + room +"\nmessage: " + message;

        Logger.getInstance().add(log);
    } catch (PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}
 
开发者ID:Su-Yong,项目名称:NewKakaoBot,代码行数:34,代码来源:KakaoTalkListener.java

示例2: send

import android.app.RemoteInput; //导入依赖的package包/类
public static void send(String room, String message) throws IllegalArgumentException { // @author ManDongI
    Notification.Action session = null;

    for(Session i : sessions) {
        if(i.room.equals(room)) {
            session = i.session;

            break;
        }
    }

    if(session == null) {
        throw new IllegalArgumentException("Can't find the room");
    }

    Intent sendIntent = new Intent();
    Bundle msg = new Bundle();
    for (RemoteInput inputable : session.getRemoteInputs()) msg.putCharSequence(inputable.getResultKey(), message);
    RemoteInput.addResultsToIntent(session.getRemoteInputs(), sendIntent, msg);

    try {
        session.actionIntent.send(context, 0, sendIntent);
    } catch (PendingIntent.CanceledException e) {
        e.printStackTrace();
    }
}
 
开发者ID:Su-Yong,项目名称:KakaoBot,代码行数:27,代码来源:KakaoTalkListener.java

示例3: fromCompat

import android.app.RemoteInput; //导入依赖的package包/类
static RemoteInput[] fromCompat(RemoteInputCompatBase.RemoteInput[] srcArray) {
    if (srcArray == null) {
        return null;
    }
    RemoteInput[] result = new RemoteInput[srcArray.length];
    for (int i = 0; i < srcArray.length; i++) {
        RemoteInputCompatBase.RemoteInput src = srcArray[i];
        result[i] = new RemoteInput.Builder(src.getResultKey())
                .setLabel(src.getLabel())
                .setChoices(src.getChoices())
                .setAllowFreeFormInput(src.getAllowFreeFormInput())
                .addExtras(src.getExtras())
                .build();
    }
    return result;
}
 
开发者ID:GigigoGreenLabs,项目名称:permissionsModule,代码行数:17,代码来源:RemoteInputCompatApi20.java

示例4: onReceive

import android.app.RemoteInput; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
	// Get remote input
	Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
	// Exit if remote input is null (always true for API < 24)
	if (remoteInput == null) {
		return;
	}
	// Get reply text
	String reply = remoteInput.getString(KEY_TEXT_REPLY);
	// Create reply notification
	Notification replyNotification =
			new Notification.Builder(context)
					.setSmallIcon(R.drawable.ic_notifications_active_black_24dp)
					.setContentTitle("Reply received!")
					.setContentText(reply)
					.build();
	// Send reply notification
	NotificationManager notificationManager =
			(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
	notificationManager.notify(REPLY_NOTIFICATION_ID, replyNotification);
}
 
开发者ID:hkosacki,项目名称:discover-android-n,代码行数:23,代码来源:ReplyBroadcastReceiver.java

示例5: fromCompat

import android.app.RemoteInput; //导入依赖的package包/类
static RemoteInput[] fromCompat(RemoteInputCompatBase.RemoteInput[] paramArrayOfRemoteInput)
{
  RemoteInput[] arrayOfRemoteInput;
  if (paramArrayOfRemoteInput == null) {
    arrayOfRemoteInput = null;
  }
  for (;;)
  {
    return arrayOfRemoteInput;
    arrayOfRemoteInput = new RemoteInput[paramArrayOfRemoteInput.length];
    for (int i = 0; i < paramArrayOfRemoteInput.length; i++)
    {
      RemoteInputCompatBase.RemoteInput localRemoteInput = paramArrayOfRemoteInput[i];
      arrayOfRemoteInput[i] = new RemoteInput.Builder(localRemoteInput.getResultKey()).setLabel(localRemoteInput.getLabel()).setChoices(localRemoteInput.getChoices()).setAllowFreeFormInput(localRemoteInput.getAllowFreeFormInput()).addExtras(localRemoteInput.getExtras()).build();
    }
  }
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:18,代码来源:RemoteInputCompatApi20.java

示例6: addAction

import android.app.RemoteInput; //导入依赖的package包/类
public static void addAction(Notification.Builder paramBuilder, NotificationCompatBase.Action paramAction)
{
  Notification.Action.Builder localBuilder = new Notification.Action.Builder(paramAction.getIcon(), paramAction.getTitle(), paramAction.getActionIntent());
  if (paramAction.getRemoteInputs() != null)
  {
    RemoteInput[] arrayOfRemoteInput = RemoteInputCompatApi20.fromCompat(paramAction.getRemoteInputs());
    int i = arrayOfRemoteInput.length;
    for (int j = 0; j < i; j++) {
      localBuilder.addRemoteInput(arrayOfRemoteInput[j]);
    }
  }
  if (paramAction.getExtras() != null) {
    localBuilder.addExtras(paramAction.getExtras());
  }
  paramBuilder.addAction(localBuilder.build());
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:17,代码来源:NotificationCompatApi20.java

示例7: a

import android.app.RemoteInput; //导入依赖的package包/类
public static void a(Notification.Builder paramBuilder, ea paramea)
{
  Notification.Action.Builder localBuilder = new Notification.Action.Builder(paramea.a(), paramea.b(), paramea.c());
  if (paramea.e() != null)
  {
    RemoteInput[] arrayOfRemoteInput = a(paramea.e());
    int i1 = arrayOfRemoteInput.length;
    for (int i2 = 0; i2 < i1; i2++) {
      localBuilder.addRemoteInput(arrayOfRemoteInput[i2]);
    }
  }
  if (paramea.d() != null) {
    localBuilder.addExtras(paramea.d());
  }
  paramBuilder.addAction(localBuilder.build());
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:17,代码来源:efj.java

示例8: getNotificationReply

import android.app.RemoteInput; //导入依赖的package包/类
@Nullable
static String getNotificationReply(Intent intent) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
        // RemoteInput was added in KITKAT_WATCH.
        if (intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_REPLY) != null) {
            // If the notification click went through the job scheduler, we will have set
            // the reply as a standard string extra.
            return intent.getStringExtra(NotificationConstants.EXTRA_NOTIFICATION_REPLY);
        }
        Bundle remoteInputResults = RemoteInput.getResultsFromIntent(intent);
        if (remoteInputResults != null) {
            CharSequence reply =
                    remoteInputResults.getCharSequence(NotificationConstants.KEY_TEXT_REPLY);
            if (reply != null) {
                return reply.toString();
            }
        }
    }
    return null;
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:21,代码来源:NotificationPlatformBridge.java

示例9: fromCompat

import android.app.RemoteInput; //导入依赖的package包/类
static RemoteInput[] fromCompat(RemoteInputCompatBase.RemoteInput aremoteinput[])
    {
        if (aremoteinput != null) goto _L2; else goto _L1
_L1:
        RemoteInput aremoteinput1[] = null;
_L4:
        return aremoteinput1;
_L2:
        RemoteInput aremoteinput2[] = new RemoteInput[aremoteinput.length];
        int i = 0;
        do
        {
            aremoteinput1 = aremoteinput2;
            if (i >= aremoteinput.length)
            {
                continue;
            }
            RemoteInputCompatBase.RemoteInput remoteinput = aremoteinput[i];
            aremoteinput2[i] = (new android.app.RemoteInput.Builder(remoteinput.getResultKey())).setLabel(remoteinput.getLabel()).setChoices(remoteinput.getChoices()).setAllowFreeFormInput(remoteinput.getAllowFreeFormInput()).addExtras(remoteinput.getExtras()).build();
            i++;
        } while (true);
        if (true) goto _L4; else goto _L3
_L3:
    }
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:25,代码来源:RemoteInputCompatApi20.java

示例10: toCompat

import android.app.RemoteInput; //导入依赖的package包/类
static RemoteInputCompatBase.RemoteInput[] toCompat(RemoteInput aremoteinput[], RemoteInputCompatBase.RemoteInput.Factory factory)
    {
        if (aremoteinput != null) goto _L2; else goto _L1
_L1:
        RemoteInputCompatBase.RemoteInput aremoteinput1[] = null;
_L4:
        return aremoteinput1;
_L2:
        RemoteInputCompatBase.RemoteInput aremoteinput2[] = factory.newArray(aremoteinput.length);
        int i = 0;
        do
        {
            aremoteinput1 = aremoteinput2;
            if (i >= aremoteinput.length)
            {
                continue;
            }
            RemoteInput remoteinput = aremoteinput[i];
            aremoteinput2[i] = factory.build(remoteinput.getResultKey(), remoteinput.getLabel(), remoteinput.getChoices(), remoteinput.getAllowFreeFormInput(), remoteinput.getExtras());
            i++;
        } while (true);
        if (true) goto _L4; else goto _L3
_L3:
    }
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:25,代码来源:RemoteInputCompatApi20.java

示例11: getNotificationReply

import android.app.RemoteInput; //导入依赖的package包/类
@Nullable
private static String getNotificationReply(Intent intent) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
        // RemoteInput was added in KITKAT_WATCH.
        Bundle remoteInputResults = RemoteInput.getResultsFromIntent(intent);
        if (remoteInputResults != null) {
            CharSequence reply =
                    remoteInputResults.getCharSequence(NotificationConstants.KEY_TEXT_REPLY);
            if (reply != null) {
                return reply.toString();
            }
        }
    }
    return null;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:16,代码来源:NotificationPlatformBridge.java

示例12: addAction

import android.app.RemoteInput; //导入依赖的package包/类
public static void addAction(android.app.Notification.Builder b, Action action) {
    android.app.Notification.Action.Builder actionBuilder = new android.app.Notification.Action.Builder(action.getIcon(), action.getTitle(), action.getActionIntent());
    if (action.getRemoteInputs() != null) {
        for (RemoteInput remoteInput : RemoteInputCompatApi20.fromCompat(action.getRemoteInputs())) {
            actionBuilder.addRemoteInput(remoteInput);
        }
    }
    if (action.getExtras() != null) {
        actionBuilder.addExtras(action.getExtras());
    }
    b.addAction(actionBuilder.build());
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:13,代码来源:NotificationCompatApi20.java

示例13: getActionFromActionCompat

import android.app.RemoteInput; //导入依赖的package包/类
private static Notification.Action getActionFromActionCompat(Action actionCompat) {
    android.app.Notification.Action.Builder actionBuilder = new android.app.Notification.Action.Builder(actionCompat.getIcon(), actionCompat.getTitle(), actionCompat.getActionIntent()).addExtras(actionCompat.getExtras());
    RemoteInputCompatBase.RemoteInput[] remoteInputCompats = actionCompat.getRemoteInputs();
    if (remoteInputCompats != null) {
        for (RemoteInput remoteInput : RemoteInputCompatApi20.fromCompat(remoteInputCompats)) {
            actionBuilder.addRemoteInput(remoteInput);
        }
    }
    return actionBuilder.build();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:NotificationCompatApi20.java

示例14: getActionsFromParcelableArrayList

import android.app.RemoteInput; //导入依赖的package包/类
public static Action[] getActionsFromParcelableArrayList(ArrayList<Parcelable> parcelables, Factory actionFactory, RemoteInputCompatBase.RemoteInput.Factory remoteInputFactory) {
    if (parcelables == null) {
        return null;
    }
    Action[] actions = actionFactory.newArray(parcelables.size());
    for (int i = 0; i < actions.length; i++) {
        actions[i] = getActionCompatFromAction((Notification.Action) parcelables.get(i), actionFactory, remoteInputFactory);
    }
    return actions;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:NotificationCompatApi20.java

示例15: toCompat

import android.app.RemoteInput; //导入依赖的package包/类
static RemoteInputCompatBase.RemoteInput[] toCompat(RemoteInput[] srcArray,
        RemoteInputCompatBase.RemoteInput.Factory factory) {
    if (srcArray == null) {
        return null;
    }
    RemoteInputCompatBase.RemoteInput[] result = factory.newArray(srcArray.length);
    for (int i = 0; i < srcArray.length; i++) {
        RemoteInput src = srcArray[i];
        result[i] = factory.build(src.getResultKey(), src.getLabel(), src.getChoices(),
                src.getAllowFreeFormInput(), src.getExtras());
    }
    return result;
}
 
开发者ID:GigigoGreenLabs,项目名称:permissionsModule,代码行数:14,代码来源:RemoteInputCompatApi20.java


注:本文中的android.app.RemoteInput类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。