This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import com.google.gson.annotations.Expose; | |
import com.google.gson.annotations.SerializedName; | |
public class LogoResponse { | |
@SerializedName("responses") | |
@Expose | |
private List<Response> responses = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.annotations.Expose; | |
import com.google.gson.annotations.SerializedName; | |
import java.util.List; | |
public class LogoBodyModel { | |
@SerializedName("requests") | |
@Expose | |
private List<Request> requests = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LogoBodyModel logoBodyModel = LogoPostBuilder.buildLogoDetectionBody(encodedImage); | |
Call<LogoResponse> checkImageCall = mService.checkImageLogo(logoBodyModel); | |
checkImageCall.enqueue(new Callback<LogoResponse>() { | |
@Override | |
public void onResponse(Call<LogoResponse> call, Response<LogoResponse> response) { | |
Log.d(TAG, "Got Response"); | |
if(response.body().getResponses() != null && | |
response.body().getResponses().get(0).getLogoAnnotations() != null) { | |
Log.d(TAG, "It's a: " + response.body().getResponses().get(0).getLogoAnnotations().get(0).getDescription()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LogoPostBuilder { | |
public static LogoBodyModel buildLogoDetectionBody(String image) { | |
LogoBodyModel logoBodyModel = new LogoBodyModel(); | |
ArrayList<Feature> features = new ArrayList<>(); | |
features.add(new Feature("LOGO_DETECTION", 1)); | |
Request requests = new Request(); | |
requests.setFeatures(features); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface StackActions { | |
int size(); | |
boolean isEmpty(); | |
void push(Object objectToPush); | |
Object pop() throws LinkedListEmptyException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface QueueActions { | |
boolean isEmpty(); | |
void reset(); | |
void enqueue(Object o); | |
Object first() throws EmptyQueueException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
private fun CryptoCardContent( | |
data: CryptoCardData, | |
textColor: Color | |
) { | |
Column( | |
verticalArrangement = Arrangement.SpaceBetween, | |
modifier = Modifier.size(150.dp) | |
) { | |
Row( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A composable function that represents a crypto card. | |
* | |
* @param style The style of the crypto card. Default is [CryptoCardStyle.Dark]. | |
* @param data The [CryptoCardData] data for the crypto card. | |
*/ | |
@Composable | |
fun CryptoCard( | |
style: CryptoCardStyle = CryptoCardStyle.Dark, | |
data: CryptoCardData = CryptoCardData( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var visible by remember { mutableStateOf(false) } | |
AnimatedVisibility(visible = visible) { | |
CryptoCardContent(data, textColor) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var visible by remember { mutableStateOf(false) } | |
LaunchedEffect(Unit) { | |
delay(300) | |
visible = true | |
} | |
AnimatedVisibility( | |
visible = visible, | |
) { |