Skip to content

AboutActivity - #28

Open
MichaelB-pl wants to merge 9 commits into
DroiDevs-PL:developfrom
MichaelB-pl:develop
Open

AboutActivity#28
MichaelB-pl wants to merge 9 commits into
DroiDevs-PL:developfrom
MichaelB-pl:develop

Conversation

@MichaelB-pl

Copy link
Copy Markdown
Contributor

No description provided.

…evelop

# Conflicts:
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/pl/droidevs/books/library/LibraryActivity.java
#	app/src/main/res/values/strings.xml
#	app/src/main/res/values/styles.xml

@nani92 nani92 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Few things to fix. :)


public void showContributorDetails(ImageView imageView, ConstraintLayout constraintLayout, int index) {

int FADE_DEFAULT_TIME = 250;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super, użycie zmiennych! 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niestety nazwa nie jest zgodna z konwencją 😃

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klisiewicz a jaka powinna być?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wybacz - mój błąd. Zapomniałem wyciągnąć tą zmienną poza metodę i ustawić jako static final.


Fragment previousFragment = getSupportFragmentManager().findFragmentById(R.id.fl_about);
Fragment nextFragment = ContributorFragment.newInstance();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction()/*.setReorderingAllowed(true)*/;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w jakim celu tu jest zostawiony zakomentowany kod?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bo na początku różnie animacje się zachowywały przy setReorderingAllowed(true). Ale planuję to odkomentować 😉

import pl.droidevs.books.R;

/**
* Created by micha on 09.03.2018.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ten komentarz też można by usunąć, jako że nic nie wnosi. Można ustawić w AS żeby w ogóle go nie dodawał

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wybacz 😔
Zapominam usuwać. A nie przyszło mi w ogóle do głowy aby to wyłączyć.

public OurTeamRVAdapterViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.list_item_contributor, parent, false);
return new OurTeamRVAdapterViewHolder(view);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enter przed return

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok 😁


public void showContributorDetails(ImageView imageView, ConstraintLayout constraintLayout, int index) {

int FADE_DEFAULT_TIME = 250;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niestety nazwa nie jest zgodna z konwencją 😃

int FADE_DEFAULT_TIME = 250;
int MOVE_DEFAULT_TIME = 500;

Fragment previousFragment = getSupportFragmentManager().findFragmentById(R.id.fl_about);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Czy kod odpowiedzialny za animację nie zasługuje na osobną klasę?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Może... 😜

@Override
public void onBackPressed() {
ContributorFragment myFragment = (ContributorFragment) getSupportFragmentManager().findFragmentByTag(ContributorFragment.TAG);
if (myFragment != null && myFragment.isVisible()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if for if instance of. Kod aż woła o refaktor. Trudno określić co tutaj faktycznie się dzieje.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fakt. Poprawiam to właśnie.

* Created by micha on 13.03.2018.
*/

public class AboutVPAdapter extends FragmentPagerAdapter {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co oznacz VP?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ViewPager

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W takim razie lepszą nazwą wyjdaje się:
AboutViewPagerAdapter
AboutFragmentPagerAdapter
AboutPagerAdapter

case 1:
return context.getString(R.string.about_our_team_title);
}
return "null";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co reprezentuje sobą string "null" 😄 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nie wiem... tak walnąłem w razie jakiegoś wyjątku, żeby nie było wartości null. Ale moje rozumowanie było chyba bez sensu...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pusty string byłby wystarczający.

android:textAlignment="center"
android:textColor="#000"
android:textSize="22sp"
android:textStyle="bold"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style i dimensy.

android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:background="#fff"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kolory powinny być definiowane w pliku colors.xml. Dobrym rozwiązaniem jest korzystanie ze styli, aby łatwo było w razie potrzebny zmienić cały motyw.

android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marginesy powinny pochodzić z dimensów.


</LinearLayout>

<LinearLayout

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nie powinien powstać do tego dedykowany, customy View?

<string name="see_website">See website</string>

<!-- Transitions -->
<string name="iv_avatar_transition_name">iv_avatar</string>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tutaj warto korzystać z atrybutu translatable=false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants