| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 package com.skia; | 8 package com.skia; |
| 9 | 9 |
| 10 import android.app.ActionBar; | 10 import android.app.ActionBar; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 public void onCreate(Bundle savedInstanceState) { | 36 public void onCreate(Bundle savedInstanceState) { |
| 37 super.onCreate(savedInstanceState); | 37 super.onCreate(savedInstanceState); |
| 38 | 38 |
| 39 setContentView(R.layout.layout); | 39 setContentView(R.layout.layout); |
| 40 mTitle = (TextView) findViewById(R.id.title_view); | 40 mTitle = (TextView) findViewById(R.id.title_view); |
| 41 mSampleView = new SkiaSampleView(this); | 41 mSampleView = new SkiaSampleView(this); |
| 42 mSlideList = new ArrayAdapter<String>(this, android.R.layout.simple_expa
ndable_list_item_1); | 42 mSlideList = new ArrayAdapter<String>(this, android.R.layout.simple_expa
ndable_list_item_1); |
| 43 | 43 |
| 44 try { | 44 try { |
| 45 System.loadLibrary("skia_android"); | 45 System.loadLibrary("skia_android"); |
| 46 } catch (UnsatisfiedLinkError e) { |
| 47 // This might be because skia was linked to SampleApp statically. |
| 48 } |
| 49 |
| 50 try { |
| 46 System.loadLibrary("SampleApp"); | 51 System.loadLibrary("SampleApp"); |
| 47 | 52 |
| 48 LinearLayout holder = (LinearLayout) findViewById(R.id.holder); | 53 LinearLayout holder = (LinearLayout) findViewById(R.id.holder); |
| 49 holder.addView(mSampleView, new LinearLayout.LayoutParams( | 54 holder.addView(mSampleView, new LinearLayout.LayoutParams( |
| 50 ViewGroup.LayoutParams.MATCH_PARENT, | 55 ViewGroup.LayoutParams.MATCH_PARENT, |
| 51 ViewGroup.LayoutParams.MATCH_PARENT)); | 56 ViewGroup.LayoutParams.MATCH_PARENT)); |
| 52 | 57 |
| 53 setupActionBar(); | 58 setupActionBar(); |
| 54 | 59 |
| 55 } catch (UnsatisfiedLinkError e) { | 60 } catch (UnsatisfiedLinkError e) { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); | 197 (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); |
| 193 new Thread("Add PDF to downloads") { | 198 new Thread("Add PDF to downloads") { |
| 194 @Override | 199 @Override |
| 195 public void run() { | 200 public void run() { |
| 196 final String mimeType = "application/pdf"; | 201 final String mimeType = "application/pdf"; |
| 197 manager.addCompletedDownload(title, desc, true, mimeType, path,
length, true); | 202 manager.addCompletedDownload(title, desc, true, mimeType, path,
length, true); |
| 198 } | 203 } |
| 199 }.start(); | 204 }.start(); |
| 200 } | 205 } |
| 201 } | 206 } |
| OLD | NEW |