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
<!-- NOTE: REPLACE THE CATEGORY WITH YOUR OWN PACKAGE NAME --> | |
<!-- Don't include this receiver in your main AndroidManifest as it's a security hazard --> | |
<receiver | |
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" | |
android:exported="true" | |
android:permission="@null" | |
tools:replace="android:permission"> | |
<intent-filter> | |
<action android:name="com.google.android.c2dm.intent.RECEIVE" /> | |
<category android:name="some.randome.packagename" /> |
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
---------- | |
sealed class ApiResponse<T> { | |
@Serializable data class Success<T>(val body: T) : ApiResponse<T>() | |
data class Error<T>(val error: Throwable? = null) : ApiResponse<T>() | |
} | |
---------- | |
> Task :common:compileKotlinDesktop FAILED |
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
package be.sigmadelta.template.common.presentation | |
import android.content.Context | |
import android.content.res.Configuration | |
import android.util.DisplayMetrics | |
import android.view.View | |
import android.view.ViewGroup | |
import android.view.WindowManager | |
import androidx.coordinatorlayout.widget.CoordinatorLayout | |
import androidx.fragment.app.FragmentManager |
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 Person { | |
private String _firstName; | |
private String _lastName; | |
private int _age; | |
private Address _address; | |
public Person(String firstName, String lastName, int age, Address address) { | |
_firstName = firstName; | |
_lastName = lastName; |
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 enum GreetingsLanguage { | |
FRENCH("Bonjour "), | |
ENGLISH("Hello "), | |
DUTCH("Hallo "); | |
private String _greeting; | |
GreetingsLanguage(String greeting) { | |
_greeting = greeting; | |
} |
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 GreetingsRepository { | |
public String getFrenchGreeting(String name) { | |
if (name == null || name.equals("")) { | |
Log.e("GreetingsRepository", "name: " + name + " is invalid!"); | |
return null; | |
} | |
return "Bonjour " + name + "!"; | |
} |
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 static int getNextSize(int i) { | |
return Math.Abs(i * 4); | |
} |
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 static int getNextSize(int i) { | |
//multiply it by four and make sure it is positive | |
return i > 0 ? i << 2 : ~(i << 2) + 1; | |
} |
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
cmake_minimum_required(VERSION 3.4.1) | |
# Create lists with all source files | |
file(GLOB jni_SRCS "${CMAKE_SOURCE_DIR}/src/main/jni/*.cpp") | |
file(GLOB vibrato_SRCS "${CMAKE_SOURCE_DIR}/src/main/jni/Vibrato-effect/BerVibrato/*.cpp") | |
# Default flags | |
set_property(SOURCE ${jni_SRCS} | |
APPEND_STRING PROPERTY COMPILE_FLAGS "-O3") |
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
bool SuperpoweredRenderer::process(short int *output, unsigned int numberOfSamples) { | |
bool silence = !audioPlayer->process(stereoBuffer, false, numberOfSamples); | |
if (!silence) { | |
/***************************** | |
* APPLY PROCESSING BELOW | |
*/ | |
const int nrChannels = 2; | |
for (int i = 0; i < numberOfSamples * nrChannels; ++i) { | |
stereoBuffer[i] = vibrato.processOneSample(stereoBuffer[i]); |
NewerOlder