Skip to content

Commit

Permalink
SDL tries to load file "logo.png" from assets, and use it as a startu…
Browse files Browse the repository at this point in the history
…p logo, if it fails it reverts to the usual SDL logo
  • Loading branch information
pelya committed May 20, 2011
1 parent c418f7d commit 6e9ca5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion project/java/MainActivity.java
Expand Up @@ -27,6 +27,7 @@ Java source code (C) 2009-2011 Sergii Pylypenko
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.FrameLayout;
import android.graphics.drawable.Drawable;
import android.content.res.Configuration;
import android.app.Notification;
import android.app.NotificationManager;
Expand Down Expand Up @@ -93,7 +94,14 @@ public void onClick(View v)
ImageView img = new ImageView(this);

img.setScaleType(ImageView.ScaleType.FIT_CENTER /* FIT_XY */ );
img.setImageResource(R.drawable.publisherlogo);
try
{
img.setImageDrawable(Drawable.createFromStream(getAssets().open("logo.png"), "logo.png"));
}
catch(Exception e)
{
img.setImageResource(R.drawable.publisherlogo);
}
img.setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
_layout.addView(img);

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6e9ca5f

Please sign in to comment.