Every single one of my apps need something like this. It's boring to explain in more details what's traditionally needed to make sure an AlertDialog is only shown once. Now, with this OneTimeAlertDialog.java, it's much easier to create new AlertDialogs that are only shown once.
/** Prompt that is only shown once to user. */
OneTimeAlertDialog.Builder(this, "my_dialog_key")
.setTitle("My Title")
.setMessage("My Message")
.show();
For something I use so often, I was surprised to not find a similar project on GitHub. So, I've added it: Android OneTimeAlertDialog
~ Danial Goodwin ~
Showing posts with label github. Show all posts
Showing posts with label github. Show all posts
2015-02-13
2015-01-18
Level Up - Blogger: How to add formatted code to post (with highlighting)
In many of my posts, I like to add code snippets. Blogger doesn't have good native support for displaying code with syntax and line highlighting, so I found a way to add that feature using GitHub Gists and gist-embed project on GitHub.
The following steps can mostly be used with any blog.
Step 1: Include jQuery and gist-embed within your header tags.
Step 2: Add a code element to where you want your Gist code to appear.
Example:
Source:
Nice features also included, but not shown above:
This article was mainly written for myself in the future, but I hope others can benefit from it, as well.
Links:
~ Danial Goodwin ~
The following steps can mostly be used with any blog.
Step 1: Include jQuery and gist-embed within your header tags.
<head> ... <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/gist-embed/2.0/gist-embed.min.js"></script> </head>
Step 2: Add a code element to where you want your Gist code to appear.
<code data-gist-id="" ></code>
Example:
Source:
<code data-gist-file="PrimeNumbers.cpp" data-gist-hide-footer="true" data-gist-highlight-line="9,12,35-42" data-gist-id="5789439"></code>
Nice features also included, but not shown above:
- Ability to show GitHub footer
- Remove line numbers
- Load multiple files from a Gist
- Load a signal file from a Gist
- Show only certain lines from a file
This article was mainly written for myself in the future, but I hope others can benefit from it, as well.
Links:
~ Danial Goodwin ~
2014-06-21
Book: The Inner Game
The actual title of the book that I just read is called "The Inner Game of Tennis", but this post is not about tennis.
This was a great read, and you should read this book if you play sports and have ever wondered why you play good one day and bad the next. This book may help you have a more consistent and higher gameplay.
I wrote a whole bunch of notes as I read, and you can read them on GitHub.
If it's too much trouble to click a link, then here's the TLDR (Too Long; Didn't Read) that shares just a few of the biggest points:
And, if you have already read this book or any of the other "Inner Game" books, then I'd be happy to hear your biggest take-aways.
~ Danial Goodwin ~
This was a great read, and you should read this book if you play sports and have ever wondered why you play good one day and bad the next. This book may help you have a more consistent and higher gameplay.
I wrote a whole bunch of notes as I read, and you can read them on GitHub.
If it's too much trouble to click a link, then here's the TLDR (Too Long; Didn't Read) that shares just a few of the biggest points:
- There is an inner game and outer game. There are already many great resources on the outer game.
- During practice, analyze your movements (methods includes "feeling" it, mirrors, video playback) and don't try to force any change. During game play, just let it happen naturally; trust yourself.
- Experiment with many different playing styles. The "right" style may be different for different people.
- You still may need some good outer game practice in order to gain more from these inner game tips.
- If you dislike competition, then you have the wrong idea about it.
- When playing, if you have any anxieties or frustrations, then you aren't a player of the inner game.
And, if you have already read this book or any of the other "Inner Game" books, then I'd be happy to hear your biggest take-aways.
~ Danial Goodwin ~
2014-06-04
Level Up - Android Dev: KeyboardlessEditTest
Today, I've released a new open source project that has help me build my latest app. I needed an EditText with full capabilities, except for the keyboard showing up. All of the possible answers that I found on StackOverflow and GitHub all had their limitations, especially the lack of native editing (cut/copy/select/paste) options.
All of the problems have been abstracted out to a simple subclass of EditText that you can use easily in any project.
You can try it out on GitHub now: https://github.com/danialgoodwin/android-widget-keyboardless-edittext
Or, you can go directly to test the APK: https://play.google.com/store/apps/details?id=net.simplyadvanced.simplytonegenerator
If you have any questions or need clarifications on how to use the project, then please let me know.
~ Danial Goodwin ~
All of the problems have been abstracted out to a simple subclass of EditText that you can use easily in any project.
You can try it out on GitHub now: https://github.com/danialgoodwin/android-widget-keyboardless-edittext
Or, you can go directly to test the APK: https://play.google.com/store/apps/details?id=net.simplyadvanced.simplytonegenerator
If you have any questions or need clarifications on how to use the project, then please let me know.
~ Danial Goodwin ~
2014-02-17
Level Up - Programmer: How To Quickly Setup And Use Git And GitHub
A long time ago, the first time I started trying to learn Git and GitHub, I thought it was an unnecessarily complex process. All I wanted was simple version control and easy collaboration. So, instead of learning Git, I just made everything really modular. For one of my teams, we even just worked in completely different files, and it worked out okay.
But, now, I want to explain the absolute basics on how to start, in order to drastically reduce the learning curve. You can always find more detailed information later. And, you can get started right now!
Assumptions:
- You already know what Git is.
- You are running Windows OS.
- You already have folder/file(s) in mind for added a version control system to or want to do easy collaboration on code projects.
- You want to get started with GitHub.
- You are okay with basic instructions meant for the easiest use of Git/GitHub.
Git
Step 1: Download Git.
- Make sure you have "Git Bash" to be installed also, and you can add it to your [right-click] contextual menu also during the install process. (And/or you can add Git to your Path.)
Step 2: Configure Git.
- Open Git Bash (either right-click in file explorer or find it through search)
- Type the following two lines into the console, and change the red parts to your own information:
Step 3: Setup project to work with Git.
- Navigate (using cd) the console to the directory where you want to enable Git.
- Run the following lines to setup the folder to work with Git and "save" all the files in the directory.
And, now you have version control. Just do those last two lines again whenever you want to save a new version. Change the red part to something descriptive of the change.
GitHub
Step 4: Create a GitHub account.
- If this is your first time using GitHub, you will need to create an SSH key. After entering the following, hit enter again to save to default location (your user folder/.ssh).
- Check for success by running:
Step 5: Create a new repository (sometimes called a "repo")
- Click the big green button somewhere on GitHub that says "New repository"
- Name the repo and create it.
- On the page you are navigated to, find/copy the "SSH clone URL". This will be used in the next step and looks something like, "git@github.com:danialgoodwin/MyFirstRepoNameHere.git"
Step 6: Pull From GitHub, then Push To GitHub.
- Setup the location that you will push to and pull from. The part in red should be substituted with your info from step 5. (The following should all be on one line.)
For more great information and details, please visit:
- Easy Version Control with Git
- Official GitHub site, there should be large buttons wanting to help you further.
~ Danial Goodwin ~
But, now, I want to explain the absolute basics on how to start, in order to drastically reduce the learning curve. You can always find more detailed information later. And, you can get started right now!
Assumptions:
- You already know what Git is.
- You are running Windows OS.
- You already have folder/file(s) in mind for added a version control system to or want to do easy collaboration on code projects.
- You want to get started with GitHub.
- You are okay with basic instructions meant for the easiest use of Git/GitHub.
Git
Step 1: Download Git.
- Make sure you have "Git Bash" to be installed also, and you can add it to your [right-click] contextual menu also during the install process. (And/or you can add Git to your Path.)
Step 2: Configure Git.
- Open Git Bash (either right-click in file explorer or find it through search)
- Type the following two lines into the console, and change the red parts to your own information:
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
Step 3: Setup project to work with Git.
- Navigate (using cd) the console to the directory where you want to enable Git.
- Run the following lines to setup the folder to work with Git and "save" all the files in the directory.
git initgit add .
git commit -m "Initial commit"
And, now you have version control. Just do those last two lines again whenever you want to save a new version. Change the red part to something descriptive of the change.
GitHub
Step 4: Create a GitHub account.
- If this is your first time using GitHub, you will need to create an SSH key. After entering the following, hit enter again to save to default location (your user folder/.ssh).
ssh-keygen -t rsa -C "your@email.com"- The console tells you where the public key has been saved. Open that file in Notepad++ and save the contents to GitHub.com->Profile->Edit Profile->SSH Keys->Add SSH Key. (Each arrow -> is basically another click.)
- Check for success by running:
ssh git@github.com
Step 5: Create a new repository (sometimes called a "repo")
- Click the big green button somewhere on GitHub that says "New repository"
- Name the repo and create it.
- On the page you are navigated to, find/copy the "SSH clone URL". This will be used in the next step and looks something like, "git@github.com:danialgoodwin/MyFirstRepoNameHere.git"
Step 6: Pull From GitHub, then Push To GitHub.
- Setup the location that you will push to and pull from. The part in red should be substituted with your info from step 5. (The following should all be on one line.)
git remote add origin git@github.com:andrew8088/Shazam.git- You always want to "pull" from GitHub before you begin your work because others may have updated the code:
git pull origin master- Now, you can finally update your code to GitHub!
git push origin master
For more great information and details, please visit:
- Easy Version Control with Git
- Official GitHub site, there should be large buttons wanting to help you further.
~ Danial Goodwin ~
Subscribe to:
Posts (Atom)
