Skip to content

Instantly share code, notes, and snippets.

View rjlutz's full-sized avatar

Bob Lutz rjlutz

  • Georgia Gwinnett College
  • Lawrenceville, GA
View GitHub Profile
@rjlutz
rjlutz / EditDialogFragment.java
Last active September 1, 2021 00:09
Dialog Fragment RGB, passes values back to Activity
package edu.ggc.lutz.dialogfragmentrgbpractice1sep;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
main() {
// should result in true,false,true,false,true,false
print(Palindrome.check('radar'));
print(Palindrome.check('raxdar'));
print(Palindrome.check('noon'));
print(Palindrome.check('nxoon'));
<resources>
<string name="app_name">Recipe</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="tvTitle">Bruschetta</string>
<string name="description">Recipe Image</string>
<string name="btnRecipe">View Recipe</string>
<string name="tvIngredients">Ingredients</string>
<string name="tvIngredients1">4 plum tomatoes</string>
@rjlutz
rjlutz / student.dart
Created June 10, 2020 15:00
Thorns Roses in Flutter
class Student {
final String name;
bool hidden;
Student(this.name, this.hidden);
}
@rjlutz
rjlutz / import for COLUMN_NAME_CONTENT
Last active June 1, 2020 16:55
WordList DB Helper Code Fragments
// remember to adjust the package hierarchy so that it matches you project
import static edu.ggc.lutz.sqlprototype.WordListContract.WordListEntry.COLUMN_NAME_CONTENT;
@rjlutz
rjlutz / activity_chooser.xml
Created January 28, 2020 17:00
layouts for NavUp example
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ChooserActivity">
<SeekBar
android:id="@+id/sbGrayScale"
@rjlutz
rjlutz / info.text
Last active October 10, 2019 13:17
onFinishAddNotationDialog
code is now here: https://gist.github.com/rjlutz/95b4952310a790493dc68208b83a877e
@rjlutz
rjlutz / strings.xml
Created September 25, 2019 19:09
Building zybooks BandDatabase example in Android Studio with Master/Detail Pattern
<resources>
<string name="app_name">The Band Database</string>
<string-array name="bands">
<item>The Beatles</item>
<item>Nirvana</item>
<item>U2</item>
</string-array>
<string-array name="descriptions">
@rjlutz
rjlutz / Circle.java
Last active June 25, 2019 21:04
Lists, Stacks, Queues and Priority Queues (Chapter 20) -- examples from Liang Intro to Java Comprehensive 10e
public class Circle extends GeometricObject {
private double radius;
public Circle() {
}
public Circle(double radius) {
this.radius = radius;
}
@rjlutz
rjlutz / HexagonalRing.pde
Created May 30, 2019 17:07
HexagonalRing Class for Shapes_Practice_Coding_Challenge
public class HexagonalRing extends Shape {
float sInner;
float sOuter;
HexagonalRing(float a, float b, float c, float d) {
// super(); // this happens, silently, even if omitted
x = a;
y = b;
sInner = c;