« first day (2491 days earlier)      last day (2682 days later) » 

19:08
Add descriptions and an introduction like "Please select an activity" and "Work on your vocabularly"
is there an easy way to make all gridview items same height as width?
is the content predictable?
ehm
should be 1-2 numbers
then you can either set static sizes or calculate the size of the grid layout programmatically, figure out how many grid items you want per row and set the height = to the width you need to make them fit
that's a good idea
another quick question that was bugging me, why do people add FF in front of their color code, like:

#2961e1 becomes #ff2961e1
19:14
that's the alpha value
it's optional but useful sometimes
like if you want transparent black instead of solid black
FF is full alpha, 0% transparency
ahh, never knew that
thanks
so I'm guessing that 00 would be fully transparency?
yeah 00 would be invisible
so if you want a transparent background you can just set 00 and the rest doesn't really matter and reference it as @color/transparent
sounds logical
@DaveS okay thanks
19:42
I need to pass an activity as an object. I tried with Serializable but the activity got with Serializable is different from the first, so I can do nothing with it. Is there a way?
what are you trying to do with the activity object?
I need sharedpreferences
In a class which isn't an activity
pass the shared preferences object not the activity
...and then I have to call a method of the activity
what kind of class is this?
Activities are BIG they take a lot of memory and aren't meant to be duplicated
you more than likely want the control things from the activity, not the other way around
19:48
Service
Ah, then you want to set up communication between the two
I use Messenger and Broadcast Intents
yes
here is one way to do it:
https://stackoverflow.com/questions/20594936/communication-between-activity-and-service
thanks
45
A: Communication between Activity and Service

Rachit MishraUpdate: July 10 2016 IMO I think using BroadcastReceiver for custom events is better way as the Messengers mentioned don't handle activity recreation on device rotation as well as possible memory leaks. You may create custom BroadCast Receiver for events in the activity, Then you may al...

I use that method
well I use broadcast receiver for Service -> Activity
and Messenger for Activity -> Service
19:52
Also I read that the writer uses an interface
what writer?
the writer of the first answer
Yeah the first answer
I use interfaces for my Fragments
19:55
I have an object, I pass it to a method, I do some things and in this way I modify the original object too. Isn't this possible with activities because they are particular objects or because they are too heavy?
By holding reference to an activity that may not be active you use a ton of memory by preventing it from being collected by the garbage collector
like if your service runs when the app is closed, the activity can't be destroyed while the service holds the activity reference
You really aren't going to get good results treating an Activity like an Object
I highly recommend trying to work with the processes Android sets up for you rather than trying to fight them and do things the plain old Java way. You'll find your App comes together a lot nicely.
I'll keep it in mind
So @DaveS. What if I made ChatSE only API 18+
quit it!
I mean. It's only 9% of Android users :P
20:02
then do it Tristan
doesn't bother me either way because I'm past API 18 and I'm never going to download it
@TristanWiley YOu sound like TheWanderer. He wanted to make Chat Exchange 21+, until Nathan and I told him NO :D
Look that 9% of devices is probably just forgotten relics of an ancient age sitting in a desk somewhere anyway.
The JB emulator is way faster than even the KK emulator though, so I use it the most
I just use a samsung note 7 because I want to blow myself up and still let my wife collect the life insurance.
20:05
O_O
j/k
I use a nexus 6
@DaveS Ok, much better. sudo mv TouchWhiz /dev/null
lol
Btw Dave, how's the fam?
We're good, just got settled into our first home a few weeks ago
20:09
sudo mv samsung* /dev/null for that matter
finally got the pool and yard stable, looking at getting a patio built
@DaveS Nice.
did you see the next one Adam?
I don't know what my drug dealer laced these shoes with, but I've been tripping all day.
@DaveS bravo
Sweet! Where is your house?
20:13
having a slide transition between activities, and going back to transition A makes the screen go white
are there any major flaws in transitions?
Well your first problem is you're using multiple activities instead of fragments, right guys?
Glendale Tristan
is that really that bad?
@AdamMc331 And here we see Adam makign a death wish
Adam is teasing you
I use Fragments strictly for DialogFragments and elements in a ViewPager
20:16
Oh nice! Like the area?
You might want to put your relevant code and xml in a gist Nick, I haven't see that issue before
Sorry, Nick, I was being sarcastic. We have a running joke in this room about hating fragments, so every now and then I write praise for them to bother people like codeMagic.
Glendale, Arizona
it's like 6 miles from the Arizona Cardinals Stadium
ah alright, I know how to use fragments ( a bit) but I never know when to use them instead of activities
I'll try to reproduce the problem/error with minimal code
@DaveS I mean. Do you like the area?
Also, that's awesome
20:19
I prefer fragments because they're modular and reusable, and I tend to use them whenever I can. The only times you absolutely should is like a viewpager (I think required) and a navigation drawer. If you have a nav drawer, you always want it to replace the current fragment when you select a menu item, not have it load a new activity. Otherwise you're overloading your back stack unnecessarily.
It's also easier to transition between them, compared to activities. afaik
I suck at transitions, so I don't know if activities are easier or not, but that's a possibility.
hmm
can I combine fragments with activities?
Sure, you can have as many of each as you want.
like, I am trying to make a game for a school project.

I have home page, level menu, settings, highscores, game
all of the above are activities
20:21
insert rollsafe meme Less likely to have context leaks if you only have one activity and all fragments
can I combine homepage,levelmnu,settings,highscores in a fragment
and game in another activity?
Well a fragment would only have one focus
So you'd have one activity, and inside it would rest a fragment, and you'd only display one at a time. So you'd have `MainActivity` `HomeFragment` `LevelMenuFRagment` `SettingsFragment` etc.

However, if it's for a school project and you are just trying to get it working, I'd stick with what you have
No need to overhaul it right now.
So, back to what Dave said, can you post the transition code you are using in a gist?
so 2 activities
1 activity with all the fragments
1 activity for the game

does that sound logical?
It does. It's plausible.
sure, trying to figure out which part of my code I have to include in the gist
20:24
Is the whole project on github and public? That's even easier sometimes.
Are you doing your game in pure Android?
let's see what my github privacy setting is set to
yeah, pure android. no libraries
what game is it?
it's a maze game, you have to move the ball to the hole. you have to tilt your phone to make the ball move
I think that you have to do this because your professor wants to improve your pure Android skills, isn't it?
20:30
correct
when I comment line #34 out, it works again, in this file github.com/Nick-dv/game/blob/master/app/src/main/java/nl/nickdv/…
code is still a mess though
//Lekker rustig muziekje
nice
:^)
I might aswell change it all to fragments. will probably fix the problem aswell
@TristanWiley yeah it's a good area, kind of suburbia, but close to stuff, good food, no HOA, lots of solar panels around, relatively low crime rate for the Phx area.
@Nick while you're at it, do all your network calls on the UI thread
what do you mean, which network calls
Why are you using Sqlite?
20:40
I don't really need an online database atm
I mean, you could use SharedPreference
touché
I'll write it down and look into it later
first I have to turn it all into fragments :p
@DaveS Do you have solar panels on your house?
because sharedpreferences is for a lot of data. Consider that one user said me : "
I wouldn't be afraid to store 1000 things in prefs."
Tristan, we've just got our first months energy usage so we're getting estimates in the next few weeks to get them installed
Nick it's a joke, NetworkOnMainThread Exception is one of the more common mistakes "new" people make
20:47
Oh that's awesome!
Tesla Roof? ;P
nah those are back ordered for years
probably get a modest 2-3 kWh system
you made me confused, I did know that network calls can't be on the UI, but I can't argue with someone here because I heave the least knowledge
Sweet :)
a fragment_container, should that be the element fragment?
nah that can't be right, it should be a layout, I guess?
Do you mean
getSupportFragmentManager().beginTransaction().add(R.id.yourLayout, new MyFragment()).commit(); ?
I mean the layout
21:02
ehm
I'm doing it this way:

FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();

HomeFragment homeFragment = new HomeFragment();
fragmentTransaction.add(R.id.fragment_container, homeFragment);

fragmentTransaction.commit();
it's the same :)
ahh alright
which one is better, or newer?

the supportfragmentmanager, or the one in the google guide
According to what I know, getSupportFragmentManager is from a library
posted on August 11, 2017 by Adarsh Fernando

Android Studio 3.0 Beta 2 is now available in the Canary and Dev channels. This release fixes an issue which resulted in the compiler throwing a ClassNotFoundException when you enable Java 8 language features and specify minSdkVersion 19 or higher—this also caused some code analysis tools, such as ProGuard, to fail. For more information, see issue #64527520. Known issue: If you have an exist

16
A: Using getFragmentManager() vs getSupportFragmentManager()?

Itzik SamaraIf you are using API >= 14, then use getFragmentManager() and while using Support Package you have to use getSupportFragmentManager() For Example Android Support Package v4 or v13.

21:11
alright, getFragmentManager it is.
I currently have a working fragmentmanager,
now I have to figure out how to change fragments OnClick
Maybe you can use getFragmentManager().beginTransaction().add(R.id.yourLayout, new MyFragment()).addToBackStack(null).commit(); changing new MyFragment() for each type
I mean, if you click the settings button, then there is the SettingsFragment and so on
wait,
can I change fragments, if I'm inside the fragment class?
I tought that only the activity can change the fragments
inside fragments too
you only have to call getActivity() before the fragment manager
if you are in a fragment
hmm
isn't it smarter to make a fragment manager class?
why?
21:16
so I can say

customFragmentManagerClass.goToSettings();
mmm it's only one line, I think there is no difference
both the previous and this
you guys shouldn't be talking about fragments on fridays
but in this last you have to create a class too
from the shadows, he strikes
21:19
it's working :D
I'm not stll a worker :/
your reaction should be ":)" not ":/"
really?
you'll be working your whole life anyway, no rush :D
you're right :)
21:23
that one should be a :'(
hahahaha
Lol I'm alluding to different things XD
Anyone familiar with OkHttp3?
I use the 3.7 version, but that's it
Trying to convert OkHttp2 to 3
are the apis significantly different?
Not too different, but I'm having trouble with some of the websocket stuff
I had WebSocketCall previously, but I have no idea what it is now.
21:45
from SO
> compile 'com.squareup.okhttp3:okhttp-ws:3.X'
you need to add this dependency ^
wat
If this works
I thought I read somewhere that it was merged to be included with the main package
Yeah, it didn't work :/
WHAT THE FUCK
IT TOTALLY JUST RANDOMLY WORKED
Mehdi, I love you.
haha!
22:20
funny how including your dependencies makes your project work properly
3
stfu Dave ily

« first day (2491 days earlier)      last day (2682 days later) »