mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 14:49:53 +01:00
Replace space indent with tabs
This commit is contained in:
@@ -9,9 +9,9 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
|||||||
@NotNullByDefault
|
@NotNullByDefault
|
||||||
interface UrlConverter {
|
interface UrlConverter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a raw onion address, excluding the .onion suffix, into an
|
* Converts a raw onion address, excluding the .onion suffix, into an
|
||||||
* HTTP URL.
|
* HTTP URL.
|
||||||
*/
|
*/
|
||||||
String convertOnionToBaseUrl(String onion);
|
String convertOnionToBaseUrl(String onion);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,48 +16,48 @@ import androidx.annotation.UiThread;
|
|||||||
|
|
||||||
public class QrCodeView extends FrameLayout {
|
public class QrCodeView extends FrameLayout {
|
||||||
|
|
||||||
private final ImageView qrCodeImageView;
|
private final ImageView qrCodeImageView;
|
||||||
private boolean fullscreen = false;
|
private boolean fullscreen = false;
|
||||||
private FullscreenListener listener;
|
private FullscreenListener listener;
|
||||||
|
|
||||||
public QrCodeView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
public QrCodeView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
LayoutInflater inflater = (LayoutInflater) context
|
LayoutInflater inflater = (LayoutInflater) context
|
||||||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
inflater.inflate(R.layout.qr_code_view, this, true);
|
inflater.inflate(R.layout.qr_code_view, this, true);
|
||||||
qrCodeImageView = findViewById(R.id.qr_code);
|
qrCodeImageView = findViewById(R.id.qr_code);
|
||||||
ImageView fullscreenButton = findViewById(R.id.fullscreen_button);
|
ImageView fullscreenButton = findViewById(R.id.fullscreen_button);
|
||||||
fullscreenButton.setOnClickListener(v -> {
|
fullscreenButton.setOnClickListener(v -> {
|
||||||
fullscreen = !fullscreen;
|
fullscreen = !fullscreen;
|
||||||
if (!fullscreen) {
|
if (!fullscreen) {
|
||||||
fullscreenButton.setImageResource(
|
fullscreenButton.setImageResource(
|
||||||
R.drawable.ic_fullscreen_black_48dp);
|
R.drawable.ic_fullscreen_black_48dp);
|
||||||
} else {
|
} else {
|
||||||
fullscreenButton.setImageResource(
|
fullscreenButton.setImageResource(
|
||||||
R.drawable.ic_fullscreen_exit_black_48dp);
|
R.drawable.ic_fullscreen_exit_black_48dp);
|
||||||
}
|
}
|
||||||
if (listener != null)
|
if (listener != null)
|
||||||
listener.setFullscreen(fullscreen);
|
listener.setFullscreen(fullscreen);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
public void setQrCode(Bitmap qrCode) {
|
public void setQrCode(Bitmap qrCode) {
|
||||||
qrCodeImageView.setImageBitmap(qrCode);
|
qrCodeImageView.setImageBitmap(qrCode);
|
||||||
// Simple fade-in animation
|
// Simple fade-in animation
|
||||||
AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f);
|
AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f);
|
||||||
anim.setDuration(200);
|
anim.setDuration(200);
|
||||||
qrCodeImageView.startAnimation(anim);
|
qrCodeImageView.startAnimation(anim);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiThread
|
@UiThread
|
||||||
public void setFullscreenListener(FullscreenListener listener) {
|
public void setFullscreenListener(FullscreenListener listener) {
|
||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface FullscreenListener {
|
public interface FullscreenListener {
|
||||||
void setFullscreen(boolean fullscreen);
|
void setFullscreen(boolean fullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user