Search in sources :

Example 76 with Nullable

use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.

the class StickerSelectFragment method onCreateView.

@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.scribble_select_sticker_fragment, container, false);
    this.recyclerView = (RecyclerView) view.findViewById(R.id.stickers_recycler_view);
    return view;
}
Also used : ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 77 with Nullable

use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.

the class UpdateApkJob method getDigestForDownloadId.

@Nullable
private byte[] getDigestForDownloadId(long downloadId) {
    try {
        DownloadManager downloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
        FileInputStream fin = new FileInputStream(downloadManager.openDownloadedFile(downloadId).getFileDescriptor());
        byte[] digest = FileUtils.getFileDigest(fin);
        fin.close();
        return digest;
    } catch (IOException e) {
        Log.w(TAG, e);
        return null;
    }
}
Also used : IOException(java.io.IOException) DownloadManager(android.app.DownloadManager) FileInputStream(java.io.FileInputStream) Nullable(android.support.annotation.Nullable)

Example 78 with Nullable

use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.

the class MotionView method findEntityAtPoint.

@Nullable
private MotionEntity findEntityAtPoint(float x, float y) {
    MotionEntity selected = null;
    PointF p = new PointF(x, y);
    for (int i = entities.size() - 1; i >= 0; i--) {
        if (entities.get(i).pointInLayerRect(p)) {
            selected = entities.get(i);
            break;
        }
    }
    return selected;
}
Also used : PointF(android.graphics.PointF) MotionEntity(org.thoughtcrime.securesms.scribbles.widget.entity.MotionEntity) Paint(android.graphics.Paint) Nullable(android.support.annotation.Nullable)

Example 79 with Nullable

use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.

the class KeyCachingService method getMasterSecret.

@Nullable
public static synchronized MasterSecret getMasterSecret(Context context) {
    if (masterSecret == null && TextSecurePreferences.isPasswordDisabled(context)) {
        try {
            MasterSecret masterSecret = MasterSecretUtil.getMasterSecret(context, MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
            Intent intent = new Intent(context, KeyCachingService.class);
            context.startService(intent);
            return masterSecret;
        } catch (InvalidPassphraseException e) {
            Log.w("KeyCachingService", e);
        }
    }
    return masterSecret;
}
Also used : MasterSecret(org.thoughtcrime.securesms.crypto.MasterSecret) InvalidPassphraseException(org.thoughtcrime.securesms.crypto.InvalidPassphraseException) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) Nullable(android.support.annotation.Nullable)

Example 80 with Nullable

use of android.support.annotation.Nullable in project Signal-Android by WhisperSystems.

the class PeerConnectionWrapper method createVideoCapturer.

@Nullable
private CameraVideoCapturer createVideoCapturer(@NonNull Context context) {
    Log.w(TAG, "Camera2 enumerator supported: " + Camera2Enumerator.isSupported(context));
    CameraEnumerator enumerator;
    if (Camera2Enumerator.isSupported(context))
        enumerator = new Camera2Enumerator(context);
    else
        enumerator = new Camera1Enumerator(true);
    String[] deviceNames = enumerator.getDeviceNames();
    for (String deviceName : deviceNames) {
        if (enumerator.isFrontFacing(deviceName)) {
            Log.w(TAG, "Creating front facing camera capturer.");
            final CameraVideoCapturer videoCapturer = enumerator.createCapturer(deviceName, null);
            if (videoCapturer != null) {
                Log.w(TAG, "Found front facing capturer: " + deviceName);
                return videoCapturer;
            }
        }
    }
    for (String deviceName : deviceNames) {
        if (!enumerator.isFrontFacing(deviceName)) {
            Log.w(TAG, "Creating other camera capturer.");
            final CameraVideoCapturer videoCapturer = enumerator.createCapturer(deviceName, null);
            if (videoCapturer != null) {
                Log.w(TAG, "Found other facing capturer: " + deviceName);
                return videoCapturer;
            }
        }
    }
    Log.w(TAG, "Video capture not supported!");
    return null;
}
Also used : Camera1Enumerator(org.webrtc.Camera1Enumerator) CameraEnumerator(org.webrtc.CameraEnumerator) Camera2Enumerator(org.webrtc.Camera2Enumerator) CameraVideoCapturer(org.webrtc.CameraVideoCapturer) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)582 View (android.view.View)315 TextView (android.widget.TextView)163 RecyclerView (android.support.v7.widget.RecyclerView)85 BindView (butterknife.BindView)57 ImageView (android.widget.ImageView)52 ArrayList (java.util.ArrayList)43 IOException (java.io.IOException)36 Bundle (android.os.Bundle)35 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)35 Intent (android.content.Intent)32 ViewGroup (android.view.ViewGroup)32 Cursor (android.database.Cursor)29 Uri (android.net.Uri)27 File (java.io.File)24 AdapterView (android.widget.AdapterView)22 List (java.util.List)20 NonNull (android.support.annotation.NonNull)19 Context (android.content.Context)15 Bitmap (android.graphics.Bitmap)15