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
class ItemAdapter( | |
private val itemClickListener: (OwnedItem) -> Unit, | |
private val itemSaver: (List<OwnedItem>) -> Unit | |
) : RecyclerView.Adapter<ItemViewHolder>() { | |
val items = ArrayList<OwnedItem>() | |
fun setItems(newItems: List<OwnedItem>) { | |
val result = calculateDiff(newItems) | |
items.clear() |
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 uk.co.jakelee.apodwallpaper.example | |
import uk.co.jakelee.apodwallpaper.BuildConfig | |
class MyClass() { | |
val key = BuildConfig.APOD_API_KEY | |
} |
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 convertXpToLevel(int xp) { | |
// Level = 0.05 * sqrt(xp) | |
return (int) (Constants.LEVEL_MODIFIER * Math.sqrt(xp)); | |
} | |
public static int convertLevelToXp(int level) { | |
// XP = (Level / 0.05) ^ 2 | |
return (int) Math.pow(level / Constants.LEVEL_MODIFIER, 2); | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="uk.co.jakelee.dynamiciconchanging"> | |
<application | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme"> | |
<activity android:name=".MainActivity"> | |
<intent-filter> | |
<category android:name="android.intent.category.LAUNCHER"/> |
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
<application | |
android:allowBackup="true" | |
android:fullBackupContent="@xml/backup_rules" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
{ | |
import com.google.ads.instream.api.AdErrorEvent; | |
import com.google.ads.instream.api.AdEvent; | |
import com.google.ads.instream.api.AdLoadedEvent; | |
import com.google.ads.instream.api.AdSizeChangedEvent; | |
import com.google.ads.instream.api.AdsLoadedEvent; | |
import com.google.ads.instream.api.AdsLoader; | |
import com.google.ads.instream.api.AdsManager; | |
import com.google.ads.instream.api.AdsManagerTypes; |
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
class Car( | |
@Embedded | |
val metadata: CarMetadata, | |
@Relation( | |
parentColumn = "id", // The name of the CarMetadata ID field | |
entityColumn = "carId" // The name of the Component's car ID field | |
) | |
var components: List<Component> | |
) |
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
; UNICODE FILE - edit with care ;-) | |
[Batch] | |
AdvCrop=0 | |
AdvCropX=0 | |
AdvCropY=0 | |
AdvCropW=0 | |
AdvCropH=0 | |
AdvCropC=0 | |
AdvResize=0 |
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
private static Visitor_Type selectVisitorType() { | |
Visitor_Type visitor = new Visitor_Type(); | |
List<Visitor_Type> visitorTypes = Visitor_Type.findWithQuery(Visitor_Type.class, | |
"SELECT * FROM VisitorType WHERE visitor_id NOT IN (SELECT type FROM Visitor)"); | |
// Work out the total weighting. | |
double totalWeighting = 0.0; | |
for (Visitor_Type type : visitorTypes) { | |
totalWeighting += type.getWeighting(); |
NewerOlder