Skip to content

Commit

Permalink
Add initial sample activity (empty)
Browse files Browse the repository at this point in the history
  • Loading branch information
skoric committed Jan 16, 2018
1 parent 2c7cf66 commit 365ddd2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions vangogh-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".samples.SingleAnimation"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

import com.example.vangogh.menu.MainMenuAdapter;
import com.example.vangogh.menu.MainMenuItem;
import com.example.vangogh.samples.SingleAnimation;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity implements MainMenuAdapter.OnMainMenuItemClickListener {

Expand All @@ -22,7 +24,8 @@ protected void onCreate(Bundle savedInstanceState) {

mainMenuList = findViewById(R.id.mainMenu);

MainMenuAdapter adapter = new MainMenuAdapter(this, new ArrayList<MainMenuItem>());
MainMenuAdapter adapter = new MainMenuAdapter(this, getMainMenuItems());
adapter.setOnMainMenuItemClickListener(this);
mainMenuList.setAdapter(adapter);
}

Expand All @@ -31,4 +34,11 @@ public void onMainMenuItemClicked(@NonNull MainMenuItem item) {
startActivity(new Intent(this, item.getActivity().getClass()));
}

@NonNull
public List<MainMenuItem> getMainMenuItems() {
List<MainMenuItem> items = new ArrayList<>();
items.add(new MainMenuItem("Single animation", "Showcases how single animations are executed", new SingleAnimation()));
return items;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

import com.example.vangogh.R;

import java.util.ArrayList;
import java.util.List;

public class MainMenuAdapter extends ArrayAdapter<MainMenuItem> {

private OnMainMenuItemClickListener listener;

public MainMenuAdapter(@NonNull Context context, ArrayList<MainMenuItem> items) {
public MainMenuAdapter(@NonNull Context context, List<MainMenuItem> items) {
super(context, 0, items);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.vangogh.samples;

import android.support.v7.app.AppCompatActivity;

public class SingleAnimation extends AppCompatActivity {
}

0 comments on commit 365ddd2

Please sign in to comment.